mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
I understand how you can use :error and $error and /reseterror to handle errors created by an alias, but...

How do I create a custom error with a custom message IN an alias which will trigger the above in whatever alias called my alias?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Simply put: you can't.

Depending on where you want to handle the error information, I use something akin to the following:

Code:
alias example {
  set -u0 %MyError Some Error
}

alias MyCaller {
  example

  if (%MyError) {
    goto error
  }


  :error
  var %error = $iif(%MyError, $v1, $error)
  reseterror
  if (%error != $null) {
    ;; Error occured
  }
}

Last edited by FroggieDaFrog; 16/09/18 02:01 PM.

I am SReject
My Stuff

Link Copied to Clipboard