AK: Remove unused Error functionality
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Timothy Flynn 2025-05-10 16:37:18 -04:00 committed by Tim Flynn
commit a71d909b39
Notes: github-actions[bot] 2025-05-11 01:20:42 +00:00

View file

@ -19,13 +19,12 @@ public:
Errno, Errno,
Syscall, Syscall,
Windows, Windows,
StringLiteral StringLiteral,
}; };
static Error from_errno(int code) static Error from_errno(int code)
{ {
VERIFY(code != 0); return Error(code, Kind::Errno);
return Error(code);
} }
static Error from_syscall(StringView syscall_name, int code) 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; 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_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_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; } StringView string_literal() const { return m_string_literal; }
int code() const { return m_code; }
Kind kind() const { return m_kind; } Kind kind() const { return m_kind; }
protected: private:
Error(int code, Kind kind = Kind::Errno) Error(int code, Kind kind)
: m_code(code) : m_code(code)
, m_kind(kind) , m_kind(kind)
{ {
VERIFY(code != 0);
} }
private:
Error(StringView string_literal) Error(StringView string_literal)
: m_string_literal(string_literal) : m_string_literal(string_literal)
, m_kind(Kind::StringLiteral) , m_kind(Kind::StringLiteral)