MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MakeError

Function MakeError

tensorflow/compiler/xla/status_macros.cc:75–88  ·  view source on GitHub ↗

Make a Status with a code, error message and payload, and also send it to LOG( ) using the given filename and line (unless should_log is false, or log_severity is NUM_SEVERITIES). If should_log_stack_trace is true, the stack trace is included in the log message (ignored if should_log is false).

Source from the content-addressed store, hash-verified

73// trace is included in the log message (ignored if should_log is
74// false).
75static Status MakeError(const char* filename, int line,
76 tensorflow::error::Code code, const string& message,
77 bool should_log, int log_severity,
78 bool should_log_stack_trace) {
79 if (TF_PREDICT_FALSE(code == tensorflow::error::OK)) {
80 LOG(ERROR) << "Cannot create error with status OK";
81 code = tensorflow::error::UNKNOWN;
82 }
83 const Status status = MakeStatus(code, message);
84 if (TF_PREDICT_TRUE(should_log)) {
85 LogError(status, filename, line, log_severity, should_log_stack_trace);
86 }
87 return status;
88}
89
90// This method is written out-of-line rather than in the header to avoid
91// generating a lot of inline code for error cases in all callers.

Callers 1

GetStatusMethod · 0.85

Calls 2

LogErrorFunction · 0.85
MakeStatusFunction · 0.70

Tested by

no test coverage detected