Improved baked-in error handler.