diff --git a/deps/oxlib/src/std/include/ox/std/error.hpp b/deps/oxlib/src/std/include/ox/std/error.hpp index 98a4fd05..4e03a5dc 100644 --- a/deps/oxlib/src/std/include/ox/std/error.hpp +++ b/deps/oxlib/src/std/include/ox/std/error.hpp @@ -345,6 +345,21 @@ struct [[nodiscard]] Result { return *this; } + constexpr Result reoriginate( + ErrorCode const pErrCode, + CString const pMsg = nullptr, + std::source_location const &pSrc = std::source_location::current()) const && noexcept { + if (error) { + return {std::move(value), Error{pErrCode, pMsg, pSrc}}; + } + return Error{}; + } + + constexpr Result reoriginate( + std::source_location const &pSrc = std::source_location::current()) const && noexcept { + return {std::move(value), Error{error.errCode, error.msg, pSrc}}; + } + }; namespace detail {