error log before throw