From a71d909b39fe1640e6a5edca7fc9c6f1ea9038ec Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 10 May 2025 16:37:18 -0400 Subject: [PATCH] AK: Remove unused Error functionality --- AK/Error.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/AK/Error.h b/AK/Error.h index 9f4679b5b88..910f917bd40 100644 --- a/AK/Error.h +++ b/AK/Error.h @@ -19,13 +19,12 @@ public: Errno, Syscall, Windows, - StringLiteral + StringLiteral, }; static Error from_errno(int code) { - VERIFY(code != 0); - return Error(code); + return Error(code, Kind::Errno); } static Error from_syscall(StringView syscall_name, int code) @@ -78,25 +77,21 @@ public: return m_code == other.m_code && m_string_literal == other.m_string_literal && m_kind == other.m_kind; } - int code() const { return m_code; } bool is_errno() const { return m_kind == Kind::Errno || m_kind == Kind::Syscall; } - bool is_syscall() const { return m_kind == Kind::Syscall; } - bool is_windows_error() const { return m_kind == Kind::Windows; } - bool is_string_literal() const { return m_kind == Kind::StringLiteral; } StringView string_literal() const { return m_string_literal; } - + int code() const { return m_code; } Kind kind() const { return m_kind; } -protected: - Error(int code, Kind kind = Kind::Errno) +private: + Error(int code, Kind kind) : m_code(code) , m_kind(kind) { + VERIFY(code != 0); } -private: Error(StringView string_literal) : m_string_literal(string_literal) , m_kind(Kind::StringLiteral)