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

Method hasStack

valdi_core/src/valdi_core/cpp/Utils/Error.cpp:52–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50Error::Error(Ref<ErrorStorage> storage) : _storage(std::move(storage)) {}
51
52bool Error::hasStack() const {
53 auto current = _storage;
54 while (current != nullptr) {
55 if (!current->stackTrace.isEmpty()) {
56 return true;
57 }
58 current = current->cause;
59 }
60
61 return false;
62}
63
64std::optional<Error> Error::getCause() const noexcept {
65 if (_storage == nullptr || _storage->cause == nullptr) {

Callers 1

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected