mIRC Home    About    Download    Register    News    Help

Print Thread
catch errors, problem #162559 20/10/06 12:07 AM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
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

Re: catch errors, problem #162560 20/10/06 12:23 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
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 }
}

Last edited by deegee; 20/10/06 12:25 AM.
Re: catch errors, problem #162561 20/10/06 02:25 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 }
}

Re: catch errors, problem #162562 20/10/06 05:50 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
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
}

Re: catch errors, problem [Re: deegee] #179202 19/06/07 05:28 AM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
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!
Re: catch errors, problem [Re: MeStinkBAD] #179212 19/06/07 09:11 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Then suggest it rather than bringing up a post that's been dead almost a year. shocked

Last edited by SladeKraven; 19/06/07 09:11 AM.
Re: catch errors, problem [Re: SladeKraven] #179240 19/06/07 04:24 PM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
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!