mIRC Home    About    Download    Register    News    Help

Topic Options
#162559 - 20/10/06 01:07 AM catch errors, problem
pouncer Offline
Hoopy frood

Registered: 02/10/05
Posts: 827
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

Top
#162560 - 20/10/06 01:23 AM Re: catch errors, problem
deegee Offline
Fjord artisan

Registered: 16/06/06
Posts: 508
Loc: Storage
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 }
}


Edited by deegee (20/10/06 01:25 AM)

Top
#162561 - 20/10/06 03:25 AM Re: catch errors, problem
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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 }
}

Top
#162562 - 20/10/06 06:50 AM Re: catch errors, problem
deegee Offline
Fjord artisan

Registered: 16/06/06
Posts: 508
Loc: Storage
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
}

Top
#179202 - 19/06/07 06:28 AM Re: catch errors, problem [Re: deegee]
MeStinkBAD Offline
Fjord artisan

Registered: 07/04/03
Posts: 342
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!
_________________________
Beware of MeStinkBAD! He knows more than he actually does!

Top
#179212 - 19/06/07 10:11 AM Re: catch errors, problem [Re: MeStinkBAD]
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Then suggest it rather than bringing up a post that's been dead almost a year. shocked


Edited by SladeKraven (19/06/07 10:11 AM)

Top
#179240 - 19/06/07 05:24 PM Re: catch errors, problem [Re: SladeKraven]
MeStinkBAD Offline
Fjord artisan

Registered: 07/04/03
Posts: 342
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.
_________________________
Beware of MeStinkBAD! He knows more than he actually does!

Top