| 50 | Error::Error(Ref<ErrorStorage> storage) : _storage(std::move(storage)) {} |
| 51 | |
| 52 | bool 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 | |
| 64 | std::optional<Error> Error::getCause() const noexcept { |
| 65 | if (_storage == nullptr || _storage->cause == nullptr) { |
no test coverage detected