chillout___, type /help Error handling in mIRC and see if this is what you are looking for. (This is the :error thing that argv0 was alluding to.)

If it's not, can you give an example of what sort of error you want to intercept that can't be done through this method?