diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-25 17:57:06 -0500 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-01-26 10:43:30 +0000 |
commit | 66f98237a7365ca8e7f053e8c51a6ef1a7594ae7 (patch) | |
tree | 71d577e6f94eb8e09920bb0339d3b08d3f1ebe8f | |
parent | 452285a3f8a0550498d963dc066902d93099a131 (diff) | |
download | serenity-66f98237a7365ca8e7f053e8c51a6ef1a7594ae7.zip |
LibSQL: Don't interpret AK::Error codes as SQL error codes
This makes error invocations such as Error::from_string_literal become
associated with a SQLErrorCode (typically 0, AmbiguousColumnName). The
result, when displayed to the user, is quite confusing, e.g.:
Column name 'Heap()::write_block(): Oversized block' is ambiguous
Instead, just interpret these as internal errors, so the error message
is displayed as-is.
-rw-r--r-- | Userland/Libraries/LibSQL/Result.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibSQL/Result.h b/Userland/Libraries/LibSQL/Result.h index e965ada00b..bf85ea6003 100644 --- a/Userland/Libraries/LibSQL/Result.h +++ b/Userland/Libraries/LibSQL/Result.h @@ -94,7 +94,7 @@ public: } ALWAYS_INLINE Result(Error error) - : m_error(static_cast<SQLErrorCode>(error.code())) + : m_error(SQLErrorCode::InternalError) , m_error_message(error.string_literal()) { } |