Skip to content

Commit c89685a

Browse files
author
Kutta Srinivasan
committed
Make error messages in net_dag more clear
1 parent 5f90d41 commit c89685a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

caffe2/core/net_dag.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ void DAGNetBase::HandleException(
193193
operator_nodes_[operator_idx].operator_->debug_def().name();
194194
const std::string& operator_type =
195195
operator_nodes_[operator_idx].operator_->debug_def().type();
196-
const char* prefix = "Exception from operator '";
196+
const char* prefix = "Exception from operator chain starting at '";
197197
#ifdef CAFFE2_USE_EXCEPTION_PTR
198198
if (!caught_exception_yet_.exchange(true)) {
199199
caught_exception_ = std::current_exception();
200200
} else {
201-
prefix = "Secondary exception from operator '";
201+
prefix = "Secondary exception from operator chain starting at '";
202202
}
203203
#endif // CAFFE2_USE_EXCEPTION_PTR
204204
LOG(ERROR) << prefix << operator_name << "' (type '" << operator_type
@@ -228,7 +228,7 @@ void DAGNetBase::WorkerFunction() {
228228
task_timers_[idx]->MicroSeconds());
229229
}
230230

231-
VLOG(1) << "Running operator #" << idx << " "
231+
VLOG(1) << "Running chain starting at operator #" << idx << " "
232232
<< operator_nodes_[idx].operator_->debug_def().name() << "("
233233
<< operator_nodes_[idx].operator_->debug_def().type() << ").";
234234
CAFFE_ENFORCE(
@@ -244,7 +244,7 @@ void DAGNetBase::WorkerFunction() {
244244
if (!this_success) {
245245
// If an exception was thrown, the operator def will get printed
246246
// by Operator::Run[Async], but if no exception occurs we print it here.
247-
LOG(ERROR) << "Operator chain failed: "
247+
LOG(ERROR) << "Operator chain failed starting at: "
248248
<< ProtoDebugString(
249249
operator_nodes_[idx].operator_->debug_def());
250250
}

0 commit comments

Comments
 (0)