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:

Code:
/error <error message>


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:

Code:
alias test {
  if ($1) return success
  error $!test: insufficient parameters
}
alias testing {
  test

  :error
  echo -s Testing received error message: $error
  reseterror
}


calling:

Code:
/testing


should output:

Code:
Testing received error message: $test: insufficient parameters (line 6, test.mrc)


and calling from an edit box:

Code:
//noop $test


should output:

Code:
-
* $test: insufficient parameters
-




Edited by SykO (16/02/19 10:23 PM)