Skip to content

Commit

Permalink
πŸ› Properly detects error message from the Firebird driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Jan 25, 2025
1 parent 920de74 commit ee92ff1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export const FirebirdConnectionErrors = {
}

export function isFirebirdConnectionError(error) {
if (!error || !(error instanceof Error)) {
if (!error) {
return false
}
if (String(error.code) in FirebirdConnectionErrors) {
return true

if (error instanceof Error || typeof error === "object") {
if (String(error?.code) in FirebirdConnectionErrors) {
return true
}
}

const msg = String(error)
Expand Down

0 comments on commit ee92ff1

Please sign in to comment.