/throwerror for use with :error - 16/04/07 01:50 PM
Although I brought up the idea here, I think the suggestion is good enough that it needs it's own thread...
I would like to see a /throwerror command that generates an error that propogrates back to a calling alias and sets $error to whatever is specified for arguments to /throwerror
In addition, an $errorsource identifer that reports the name of the alias throwing the error.
I would like to see a /throwerror command that generates an error that propogrates back to a calling alias and sets $error to whatever is specified for arguments to /throwerror
In addition, an $errorsource identifer that reports the name of the alias throwing the error.
Code:
alias { dothis goto end :error echo -s $errorsource threw the error message: $error :end } alias dothis if ($1 == $null) /throwerror No arguments specified ; using /throwerror will also stop handling the alias echo -s only got here if $ $+ 1 is specified }