-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors when loading Thorfiles do not include stacktrace #36
Comments
Fixed in in my fork at technicalpickles/thor@f85c87b. I ended up just doing a puts of the error's backtrace. |
I think it's probably acceptable, but I'm hesitant to change it. If I were fixing it myself I'd probably either show the top line of the stack trace or print the whole thing out to a log file. |
The top line of the backtrace wouldn't be sufficient in a lot of cases, I think. It's only useful if the error comes from a line in the Thorfile. Logging it would be better, but I think it's a little overkill. If you're working on a thorfile in the current directory, and you are trying to call tasks defined in it, I really want to see backtraces that happened, and not have to know that there's an error log somewhere, and then actually open the file. |
Fwiw, I believe this was added to prevent misbehaving global Thor helpers from always bombing Thor out. Do you guys have any thoughts on making that case usable/not horrible? |
Yeah, it was added to prevent thor from exploding due to some bad files. Showing the whole backtrace would be cumbersome, +1 for showing just the first line. You can invoke thor path/to/faulty/Thorfile --debug to get the whole error (at least I hope so). |
I did what josevalim suggested. Find the commit here. |
Whenever errors/exceptions are encountered, only the error's type and message are displayed, excluding any sort of line information. For example, I had an uninitialized constant because I forgot to do a require, and I get this message:
I probably figure out this one just by looking at the code in Thorfile, but sometimes the error originates from code outside the code, and then it's basically impossible to debug.
It's a pretty easy fix to change thor to raise the error instead of putsing it. But the question remains, would this be acceptable for thor to do?
The text was updated successfully, but these errors were encountered: