doc error handler