super3 / IRC-Bot

A very little basic IRCBot that will get improved over the next time.
http://www.wildphp.com
102 stars 47 forks source link

Add proper error handling #49

Open NanoSector opened 9 years ago

NanoSector commented 9 years ago

Right now the bot crashes on almost any error that occurs. I have a !exec command up that handles executing PHP code (only by me), but I have to triple-check my code because the bot will crash if anything is wrong with it.

Possibly the main loop could be wrapped in a try {} catch {exception} statement, but that won't catch everything. To add proper error handling the bot'll need a custom error handler like described here: http://php.net/manual/en/function.set-error-handler.php