MCPcopy Create free account
hub / github.com/Snapchat/Valdi / flatten

Method flatten

valdi_core/src/valdi_core/cpp/Utils/Error.cpp:139–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139Error Error::flatten() const {
140 if (_storage == nullptr || _storage->cause == nullptr) {
141 return *this;
142 }
143
144 auto message = toString(false);
145 StringBox stacktrace;
146
147 auto current = _storage;
148 while (current != nullptr && stacktrace.isEmpty()) {
149 stacktrace = current->stackTrace;
150 current = current->cause;
151 }
152
153 return Error(StringCache::getGlobal().makeString(std::move(message)), std::move(stacktrace), nullptr);
154}
155
156bool Error::operator==(const Error& other) const noexcept {
157 if (_storage != nullptr && other._storage != nullptr) {

Callers 4

iFunction · 0.45
micromatch.jsFile · 0.45
onUncaughtJsErrorMethod · 0.45

Calls 5

getGlobalFunction · 0.85
makeStringMethod · 0.80
ErrorClass · 0.70
toStringFunction · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected