If you know your java or your PHP 5 (yes, go look at the slideshow), you'll have come across the error/exception handling mechanism of try/catch...
For those that don't know, here's a -PSUEDOCODE- example:
alias fakething {
try {
echo -s $ip $nick $ticks
return YAY
} catch (ExceptionType e) {
return ERROR! Something went wrong!
} finally {
echo -s Errors occured!
}
}
What happens is that if for some reason $ip, $nick, or $icks, or even echo -s doesn't work, instead of spitting out * Invalid parameters; blah line blah, it would return "ERROR! Something went wrong!", and execute the code in the finally {} statement.
This is good for situations like working with com objects, where if something goes wrogn in a majro fashion, you want to close the com object down before returning from the alias.
Or with sockets. Or anyhting that blurs the line of robustness (DLL calls...)
you could also customise errors to be handled by aliases, view a /throw command;
ie
try {
echo -s Making an error on purpose!
throw CustomErr $1-
}
alias customerr {
echo -s An error occured with the parameters: $1-
}
Output would be:
Making an error on purpose!
An error occured with the parameters: blah blah
Its possible to do with a tangle of goto loops, but thats just not friendly.