MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / FormatMsgOfStackFrame

Function FormatMsgOfStackFrame

oneflow/core/common/error_util.cpp:104–113  ·  view source on GitHub ↗

msg in stack frame

Source from the content-addressed store, hash-verified

102
103// msg in stack frame
104Maybe<std::string> FormatMsgOfStackFrame(std::string error_msg, bool is_last_stack_frame) {
105 const bool debug_mode = GetGraphDebugMode();
106 // only shorten the message if it is not the last stack frame AND not in debug mode
107 if (!is_last_stack_frame && !debug_mode) { error_msg = *JUST(ShortenMsg(error_msg)); }
108 // error_msg of last stack frame come from "<<"
109 if (is_last_stack_frame) { error_msg = StripSpace(error_msg); }
110 std::stringstream ss;
111 if (!error_msg.empty()) { ss << "\n " << error_msg; }
112 return ss.str();
113}
114
115// the msg in error type instance.
116Maybe<std::string> FormatMsgOfErrorType(const std::shared_ptr<StackedError>& error) {

Callers 1

FormatErrorStrFunction · 0.85

Calls 4

GetGraphDebugModeFunction · 0.85
ShortenMsgFunction · 0.85
StripSpaceFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected