summaryrefslogtreecommitdiff
path: root/deimos/core/status.h
diff options
context:
space:
mode:
Diffstat (limited to 'deimos/core/status.h')
-rw-r--r--deimos/core/status.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/deimos/core/status.h b/deimos/core/status.h
index 8141dad..3738ae9 100644
--- a/deimos/core/status.h
+++ b/deimos/core/status.h
@@ -14,6 +14,7 @@ enum class StatusCode : uint32_t
kInvalidArgument,
kUnimplemented,
kInternal,
+ kRuntime,
};
StringView StatusCodeToString(StatusCode code);
@@ -106,6 +107,11 @@ inline Status InternalError(StringView message = {})
return Status(StatusCode::kInternal, message);
}
+inline Status RuntimeError(StringView message = {})
+{
+ return Status(StatusCode::kRuntime, message);
+}
+
namespace statusor_internals
{
};
@@ -150,7 +156,7 @@ public:
Expects(!m_status.ok());
if (m_status.ok())
{
- m_status = InternalError("StatusOr constructed from OK");
+ m_status = InvalidArgumentError("StatusOr constructed from OK");
}
}
@@ -159,7 +165,7 @@ public:
Expects(!m_status.ok());
if (m_status.ok())
{
- m_status = InternalError("StatusOr constructed from OK");
+ m_status = InvalidArgumentError("StatusOr constructed from OK");
}
}