|
@@ -25,6 +25,12 @@ public:
|
|
|
ALWAYS_INLINE Error& operator=(Error&&) = default;
|
|
|
|
|
|
[[nodiscard]] static Error from_errno(int code) { return Error(code); }
|
|
|
+
|
|
|
+ // NOTE: For calling this method from within kernel code, we will simply print
|
|
|
+ // the error message and return the errno code.
|
|
|
+ // For calling this method from userspace programs, we will simply return from
|
|
|
+ // the Error::from_string_view method!
|
|
|
+ [[nodiscard]] static Error from_string_view_or_print_error_and_return_errno(StringView string_literal, int code);
|
|
|
[[nodiscard]] static Error from_syscall(StringView syscall_name, int rc) { return Error(syscall_name, rc); }
|
|
|
[[nodiscard]] static Error from_string_view(StringView string_literal) { return Error(string_literal); }
|
|
|
|