mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
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
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:
parent
08e82ddaf0
commit
a71d909b39
Notes:
github-actions[bot]
2025-05-11 01:20:42 +00:00
Author: https://github.com/trflynn89
Commit: a71d909b39
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4689
1 changed files with 6 additions and 11 deletions
17
AK/Error.h
17
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue