-
Notifications
You must be signed in to change notification settings - Fork 81
Error Reporting
DavyLandman edited this page Sep 20, 2012
·
6 revisions
This is a guide for rascal developers on how to report errors to the user.
There are only 2 kinds of errors:
- errors the user should see
- errors only a rascal developer should see
Always write to the evaluator.getStdErr() stream. Getting the reference to the evaluator is often just a . away.
- Function called from console: the error will print in the console
- Function called as a callback (vis-framework, ide-contributions): the error will always print in the output window
Always send the exception to Activator.log(msg, exception), (no need for the .getInstance() call). Or if you are just debugging, send it to System.err.
It will be reported to the errors view, which is not part of the default rascal perspective. So never report an error to this if the user might be interested in the fact that the code failed.