diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index e440f7bb..a9eff7eb 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -62,6 +62,8 @@ struct [[nodiscard]] Error { return errCode; } + constexpr void throwException() const; + constexpr Error reoriginate( ErrorCode const pErrCode, CString const pMsg = nullptr, @@ -121,6 +123,14 @@ struct Exception: public std::exception { } }; + +constexpr void Error::throwException() const { + if (errCode) [[unlikely]] { + throw Exception{*this}; + } +} + + [[noreturn]] void panic( Error const &err,