Allow user to pass its own error handler