MCPcopy Create free account
hub / github.com/apple/foundationdb / Error

Method Error

flow/Error.cpp:106–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106Error::Error(int error_code) : error_code(error_code), flags(0) {
107 if (TRACE_SAMPLE())
108 TraceEvent(SevSample, "ErrorCreated").detail("ErrorCode", error_code);
109 // std::cout << "Error: " << error_code << std::endl;
110 if (error_code >= 3000 && error_code < 6000) {
111 {
112 TraceEvent te(SevError, "SystemError");
113 te.error(*this).backtrace();
114 if (error_code == error_code_unknown_error) {
115 auto exception = std::current_exception();
116 if (exception) {
117 try {
118 std::rethrow_exception(exception);
119 } catch (std::exception& e) {
120 te.detail("StdException", e.what());
121 } catch (...) {
122 }
123 }
124 }
125 }
126 if (g_crashOnError) {
127 flushOutputStreams();
128 flushTraceFileVoid();
129 crashAndDie();
130 }
131 }
132
133#if DEBUG_ERROR
134 if (SHOULD_LOG_ERROR(error_code)) {
135 TraceEvent te(SevWarn, "DebugError");
136 te.error(*this).backtrace();
137 if (error_code == error_code_unknown_error) {
138 auto exception = std::current_exception();
139 if (exception) {
140 try {
141 std::rethrow_exception(exception);
142 } catch (std::exception& e) {
143 te.detail("StdException", e.what());
144 } catch (...) {
145 }
146 }
147 }
148 }
149#endif
150}
151
152ErrorCodeTable& Error::errorCodeTable() {
153 static ErrorCodeTable table;

Callers 15

sendErrorResponseFunction · 0.45
handleGetEncryptionKeysFunction · 0.45
jsonifyFaultArrFunction · 0.45
copyFileFunction · 0.45
StartMonitorFunction · 0.45
LoadConfigurationMethod · 0.45
acceptConfigurationMethod · 0.45
RunProcessMethod · 0.45

Calls 7

TRACE_SAMPLEFunction · 0.85
TraceEventClass · 0.85
flushOutputStreamsFunction · 0.85
flushTraceFileVoidFunction · 0.85
detailMethod · 0.80
errorMethod · 0.45
whatMethod · 0.45