From 4e327212ad5df943a772f0d86d8eea0c622d56bc Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Wed, 23 Jan 2019 14:32:59 -0800 Subject: [PATCH] Fix error reporting for dmlc::Error --- src/relay/pass/type_solver.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/relay/pass/type_solver.cc b/src/relay/pass/type_solver.cc index 502dae4aa1e0c..63bd012a813e5 100644 --- a/src/relay/pass/type_solver.cc +++ b/src/relay/pass/type_solver.cc @@ -438,8 +438,11 @@ bool TypeSolver::Solve() { rnode->resolved = false; } catch (const dmlc::Error& err) { rnode->resolved = false; - std::cout << err.what() << std::endl; - exit(1); + this->ReportError( + RELAY_ERROR( + "an internal invariant was violdated while" \ + "typechecking your program" << + err.what()), rnode->location); } // Mark inqueue as false after the function call