We currently count with a goto error, $error, and reseterror for handling errors, but we got no way of reporting errors directly. Therefore I suggest an /error command with the following format:
which just as the built-in commands do, this will try to jump to the
:error line and echo the error message and halt the script if there was no
/reseterror.
Example:
alias test {
if ($1) return success
error $!test: insufficient parameters
}
alias testing {
test
:error
echo -s Testing received error message: $error
reseterror
}
calling:
should output:
Testing received error message: $test: insufficient parameters (line 6, test.mrc)
and calling from an edit box:
should output:
-
* $test: insufficient parameters
-