Added Error module and put Source.error functions to util/error.ml.
Cleaned up failure related to values into functions in al_util.
Avoided overusing failwith in backends. Use Error.error if possible.
Changed error messages to be more useful by adding detailed explanations.
Changes specific to the backend-interpreter:
For AL-level debugging, new exceptions were added.
Backend_interpreter.Exception.Error is raised when there is an exception while stepping an instruction. (by try_step_wasm, try_step_instr)
Backend_interpreter.Exception.Error contains step(instruction), line and al function name information. These are printed with the original exception message.
Added other exceptions for indicating unexpected error related to calling functions or construction of value.
This PR handles #73.
Main Changes:
Source.error
functions toutil/error.ml
.al_util
.failwith
in backends. UseError.error
if possible.Changes specific to the backend-interpreter: For AL-level debugging, new exceptions were added.
Backend_interpreter.Exception.Error
is raised when there is an exception while stepping an instruction. (bytry_step_wasm
,try_step_instr
)Backend_interpreter.Exception.Error
contains step(instruction), line and al function name information. These are printed with the original exception message.