allow registration of an error handler