Log error from the net's run (#14035)
authorIlia Cherniavskii <iliacher@fb.com>
Fri, 16 Nov 2018 20:01:01 +0000 (12:01 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 16 Nov 2018 20:06:50 +0000 (12:06 -0800)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14035

Log error meesage in case of net's run failure

Reviewed By: andrewwdye

Differential Revision: D13085431

fbshipit-source-id: d79f76782410cd3a5bd2d8d7f5fb1e535d821051

caffe2/core/net_async_base.cc

index 6b11db5..894277e 100644 (file)
@@ -126,10 +126,14 @@ bool AsyncNetBase::handleRunError() {
     }
   }
   if (first_exc_task_id >= 0) {
+    LOG(ERROR) << "Rethrowing exception from the run of '" << Name() << "'";
     event(first_exc_task_id).RethrowException();
   }
 #endif // CAFFE2_USE_EXCEPTION_PTR
 
+  if (!success_) {
+    LOG(ERROR) << "Error encountered in the run of '" << Name() << "'";
+  }
   return success_;
 }