Stream: shorthand
Topic: Error message
Jose Costa Teixeira (Dec 03 2020 at 15:22):
is it possible to improve this error feedback?
Sushi: Line: 1 - 250 (00:05.0679)
Sushi: error Element Questionnaire.item.item.item.item.type has minimum cardinality 1 but occurs 0 time(s). (00:05.0682)
Jose Costa Teixeira (Dec 03 2020 at 15:23):
it would be really helpful to see which item.item.item.item is it complaining about
Chris Moesel (Dec 03 2020 at 16:25):
But we told you it's somewhere between line 1 and line 250! ;-)
Chris Moesel (Dec 03 2020 at 16:26):
Yeah, we can look at that. We generally try to be as helpful as we can, so I kind of wonder if there is something that makes this technically difficult to narrow down, but... hopefully it was just an oversight or general laziness on our part and we can provide something more useful in the future.
Chris Moesel (Dec 03 2020 at 16:32):
SUSHI #686. I think I'm remembering now that we do the cardinality validation after processing the instance, on the result of the instance (in JSON format) -- so we can't as easily relate a specific issue in the JSON back to the specific line of FSH in the source file. Still, we'll look at it. At a minimum I would hope we might be able to give you indexes in the path (e.g., Questionnaire.item[14].item[1].item[2].item
) -- but maybe we could also find a way to related it back to a specific line of code. Maybe.
Elliot Silver (Dec 03 2020 at 18:24):
Can you link it to a particular line of code? It's something that is missing, so there isn't a line of code to link to, right? On the other hand, including the path should be enough, then I can figure out where to put it.
David Pyke (Dec 03 2020 at 18:27):
Next thing you'll know, you'll want them to actually tell you the exact thing wrong! In my day, we only had three errors, What? Where? and How? and we liked it that way
Chris Moesel (Dec 03 2020 at 18:32):
Good point, @Elliot Silver. We can't point at a line of code that is missing. Ha. I didn't think of that. Still, as you confirmed, we could be more helpful.
@David Pyke - we could try to just dump a bunch of binary and/or assembly code to the screen instead. Then you would really need to work hard to find out what the error is. Would you prefer that? I mean, that kind of negative reinforcement would make people choose to author fewer errors because each one is so painful. That's how it works, right?
David Pyke (Dec 03 2020 at 18:33):
Absolutely! The more difficult to read the error, the better code is produced. I learned that from my IBM 370 Assembler classes
John Moehrke (Dec 03 2020 at 18:36):
correlation does not mean causation.... more difficult to use tools, are only used by more dedicated people. We need MORE people engaged, not less.
David Hay (Dec 03 2020 at 18:36):
And perhaps randomly shuffle the output as well?
David Pyke (Dec 03 2020 at 18:39):
Yeah, if I could get error messages out of order, that's so much better
Elliot Silver (Dec 03 2020 at 18:47):
David Pyke said:
Next thing you'll know, you'll want them to actually tell you the exact thing wrong! In my day, we only had three errors, What? Where? and How? and we liked it that way
What?
Elliot Silver (Dec 03 2020 at 18:48):
David Hay said:
And perhaps randomly shuffle the output as well?
I could swear it has that feature already.
Jose Costa Teixeira (Dec 03 2020 at 19:20):
Can we have a fork that only says "you messed up somehow somewhere"?
Jean Duteau (Dec 03 2020 at 19:20):
just put a random list of error messages at the top, then have the sushi output, and then put a random list of code lines at the bottom.
I was going to suggest random error messages and random code lines interspersed throughout the SUSHI output, but that seemed slightly silly.
Jose Costa Teixeira (Dec 03 2020 at 19:24):
And don't forget to make sushi muddle the INPUT fsh files, so that people really have one shot at doing right.
Jean Duteau (Dec 03 2020 at 19:24):
that would be the greatest compiler ever made!
David Pyke (Dec 03 2020 at 19:25):
mSUSHI! (mashed) IT's the future
Elliot Silver (Dec 03 2020 at 19:34):
David Pyke said:
mSUSHI! (mashed) IT's the future
Are you sure? Looks more like an IHE profile.
Chris Moesel (Dec 03 2020 at 20:07):
Great ideas, everyone. Really great. We do accept Pull Requests, so I expect to see some soon.
David Pyke (Dec 03 2020 at 21:31):
Great! I'll add my randomizer and a global replace of all error messages with "What?" and random high bit characters by EOD tomorrow. I'm glad to help move this project forward.
Gino Canessa (Dec 03 2020 at 21:54):
David Pyke said:
Great! I'll add my randomizer and a global replace of all error messages with "What?" and random high bit characters by EOD tomorrow. I'm glad to help move this project forward.
I think I'd prefer "No", and if you expand for details (or use a flag for verbose debugging info), you get "Just, no." :-P
If we need to nod to the hardcore devs, we can use the color of the text as a hint to the category of error (or line number by RGB value).
Jose Costa Teixeira (Dec 03 2020 at 22:13):
Line numbers in decimal base are quite uninteresting, i'd say
David Pyke (Dec 04 2020 at 12:59):
You're right. I'll expand them to binary, insert random bits every other bit and then convert to ASCII.
Last updated: Apr 12 2022 at 19:14 UTC