error handler, only on debug