Add error handler

Option to add your own error handler