Compare commits
1
Commits
0e0f8915e9
...
a2de8c63ce
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2de8c63ce |
@@ -92,6 +92,17 @@ namespace Echoion::Api
|
||||
template <typename T>
|
||||
using Result = Void::Result::Result<T, Error>;
|
||||
|
||||
// Concise failure factory: `return Api::fail(ErrorCode::X, "msg")` instead
|
||||
// of `return std::unexpected(Api::Error(ErrorCode::X, "msg"))`. Carries the
|
||||
// domain ErrorCode, so it cannot defer to Void::Result::fail (which builds a
|
||||
// code-less Void::Result::Error).
|
||||
[[nodiscard]] inline std::unexpected<Error> fail(ErrorCode code,
|
||||
std::string_view message,
|
||||
std::string_view source = "")
|
||||
{
|
||||
return std::unexpected(Error(code, message, source));
|
||||
}
|
||||
|
||||
enum class LogLevel : uint8_t { Debug = 0, Info, Warning, Error, Critical };
|
||||
|
||||
inline constexpr std::string LogLevelToString(const LogLevel level) noexcept
|
||||
|
||||
Reference in new issue
Block a user