mIRC Homepage

catch errors, problem

Posted By: pouncer

catch errors, problem - 20/10/06 12:07 AM

Code:
alias test {
  var %x = hello
  echo -a $dgfdgf(hello)
  :error
  if ($error) echo -a error!! $ifmatch
}


-
error!! * /echo: insufficient parameters
-
* /echo: insufficient parameters
-

why does it give the mirc error too? im tryng to make the format of the errors in the status screen neater, by catching them in the :error and echoing them nicely
Posted By: deegee

Re: catch errors, problem - 20/10/06 12:23 AM

You get the mIRC error because you didn't use /reseterror.

Code:
alias test {
  var %x = hello
  echo -a $dgfdgf(hello)
  :error
  if ($error) { echo -a error!! $v1 | reseterror }
}
Posted By: DaveC

Re: catch errors, problem - 20/10/06 02:25 AM

Good practice would also be to NOT enter the error control code what so ever, unless u errored, this of course is dealt with by the IF in it, but it would be better practice to not do it.
Code:
alias test {
  var %x = hello
  echo -a $dgfdgf(hello)
  return
  :error
  if ($error) { echo -a error!! $v1 | reseterror }
}
Posted By: deegee

Re: catch errors, problem - 20/10/06 05:50 AM

Absolutely wink
Then you won't need the /if
Code:
alias test {
  var %x = hello
  echo -a $dgfdgf(hello)
  return
  :error
  echo -a error!! $error
  reseterror
}
Posted By: MeStinkBAD

Re: catch errors, problem - 19/06/07 05:28 AM

Error handleing rather sucks. I expect a lot more info than just an error string. I expect $error($error.id).id, $error($error.id).string, $error($error.id).call, etc. And the /reseterror command should also accept an error ID paramater (i.e. /reseterror [ERROR.ID]). An error ID of 0 or nothing would specify no error. Any other ID would throw that error.

Of course, mIRC lacks specific IDs (signed integers) for errors. Well for the present. Of course THIS CAN BE ADDED!
Posted By: SladeKraven

Re: catch errors, problem - 19/06/07 09:11 AM

Then suggest it rather than bringing up a post that's been dead almost a year. shocked
Posted By: MeStinkBAD

Re: catch errors, problem - 19/06/07 04:24 PM

Originally Posted By: SladeKraven
Then suggest it rather than bringing up a post that's been dead almost a year. shocked


I DID suggest it... what difference does it make if it comes after a post that was started a year ago? I would have suggested it then... but I didn't see this thread at the time.

Besides it shows how error handleing is currently done.
© 2019 mIRC Discussion Forums