Closed dantiston closed 2 years ago
Yes, stack traces are ugly, but you've cut off the actual error message from ACE:
>>> ace.parse('~/grammars/foo/erg.dat', 'Dogs bark')
/home/goodmami/grammars/foo/erg.dat: No such file or directory
Traceback (most recent call last):
...
Sometimes I avoid LBYL-style constructs because they can hide the precise location or nature of an error, but if the error message from ACE is not prominent enough, I could check for the existence of the grammar file before opening the ACE process.
@goodmami thanks, I see this was totally my fault :-) I'm running it in a unit test (hence the formatting changes) and I've been foiled by unit test placing the actual error above the summary. Thanks for dealing with my inability to do basic things!
Ah that makes sense. Yes, sometimes when I turn off stdout capture with pytest (-s
/ --capture=no
) I see that I'd accidentally left some debugging print statements in the code :roll_eyes:
Using
ace.parse
fromdelphin.ace
with the incorrect grammar path results in the following stacktrace:... which is super unfriendly -_- Can it be improved to be more specific?
EDIT: updated with better stack trace