Add logging for error handler