未验证 提交 31edad21 编写于 作者: H hong 提交者: GitHub

fix exception bug (#55216)

上级 28959ee2
......@@ -967,16 +967,19 @@ void NewIRInterpreter::RunInstruction(const Instruction& instr_node) {
instr_node.RecordEvent(place_);
} catch (platform::EnforceNotMet& ex) {
framework::InsertCallStackInfo(op->Type(), op->Attrs(), &ex);
LOG(WARNING) << instr_node.OpFunc()->phi_op_name_
<< " raises an EnforceNotMet exception "
<< platform::demangle(typeid(ex).name()) << ", " << ex.what();
exception_holder_.Catch(std::make_exception_ptr(std::move(ex)));
} catch (platform::EOFException&) {
exception_holder_.Catch(std::current_exception());
} catch (std::exception& ex) {
LOG(WARNING) << op->Type() << " raises an exception "
LOG(WARNING) << instr_node.OpFunc()->phi_op_name_ << " raises an exception "
<< platform::demangle(typeid(ex).name()) << ", " << ex.what();
exception_holder_.Catch(std::current_exception());
} catch (...) {
LOG(WARNING) << op->Type() << " raises an unknown exception";
LOG(WARNING) << instr_node.OpFunc()->phi_op_name_
<< " raises an unknown exception";
exception_holder_.Catch(std::current_exception());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册