summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/Error.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/AK/Error.h b/AK/Error.h
index 1405f07a3f..33ee2d0924 100644
--- a/AK/Error.h
+++ b/AK/Error.h
@@ -24,7 +24,11 @@ public:
ALWAYS_INLINE Error(Error&&) = default;
ALWAYS_INLINE Error& operator=(Error&&) = default;
- [[nodiscard]] static Error from_errno(int code) { return Error(code); }
+ [[nodiscard]] static Error from_errno(int code)
+ {
+ VERIFY(code != 0);
+ return Error(code);
+ }
// NOTE: For calling this method from within kernel code, we will simply print
// the error message and return the errno code.