Clean up internal errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Released
|
Medium
|
Matt Giuca |
Bug Description
Internal errors in Mars are currently quite horrible. They shouldn't happen at all, but since this is an early project, they tend to happen a lot. So they should be a lot more graceful than they currently are.
- Some code calls require.error/1, which raises a software_error (this is preferred). This includes all of the Mercury standard library, which we occasionally get errors from as well.
- Some code calls exception.throw/1, usually with a string. This is bad -- you shouldn't throw string exceptions. Replace all of these with calls to require.error/1.
- Exceptions are caught and rethrown several times (depending on where they are thrown from). Exceptions are rethrown with exception.throw/1, which wraps them in a univ_cons, rather than exception.
- Exceptions at the top level are caught and displayed specially by us if they are context.errors, but otherwise propagate to the top. The only other exceptions should be software_error, which are handled well by Mercury, but we should handle them better. Catch, reprint, and display the text "This error indicates a bug in Mars. Please report it (https:/
- Handle software errors in the interactive prompt without crashing the entire program (print the error and continue the interactive session).
Related branches
Changed in mars: | |
status: | Fix Committed → Fix Released |
Rethrow points are:
- mars.m: main
- marsc.m: main
- interactive.m: prompts_st, do_user_command, exec_stmt_internal