-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add --verbose option and hide internal part of errors by default #18
Comments
I started a new branch to deal with this, and done an initial commit (94fb8ef) that trims down the full traceback into a simple error message, along with the offending line. Example:
There's still a bit of work needed:
|
One last thing about testing -- we need to be sure that complex errors do not get masked by the simplified traceback. |
This is a good point about testing. I think Gedit will be OK, certainly for Gedit3 it'll just be using subprocess running sbot. For Gedit2 I'm fairly sure it's possible to redirect stderr (using the same method as the IDE did). We'll need to be careful using a regex replacement
We need to not munge output if the user overrides one of our methods... I guess it might be possible to walk the trace stack to check they are the correct calls somehow ? |
To add a param you'd add it to init_bot inside shoebot/sbot.py this convenience function then pass it to the bot constructor (DrawBot or NodeBot) - then it'd probably be store it inside the Grammar class. Bot is for stuff that is common to the NodeBot/DrawBot grammars (probably a lot more could be moved here, though I'm not sure this yet, as I'd like to consider supporting say the NodeBoxGL grammar which is kind of different). Grammar is a lot more basic and has the mecanics to run stuff, but doesn't specify how. Having a look at the updated gist on how shoebot works as a module https://gist.github.com/1322704 is a good place to see init_bot without loads of parameters.
The code for this hasn't fully settled down, but it can definitely be made to work (it works most of the time in gedit3, but I'm not fully happy - I still crash it regularly - however as proof of concept it's fine.). |
I've added the verbose parameter to sb_run - though non functional, I'm not sure what to change in the traceback code, so back to you :) |
About 2 years too late have integrated the change from this branch. |
if I make an erronious script like
I get an error that includes info internal to shoebot ... by default the user should just get the script error, unless they specify verbose on the commandline:
Example current output
Desired output (without --verbose) might look something like this..
The text was updated successfully, but these errors were encountered: