Skip to content

Commit

Permalink
refactor(db/connection): additional info for auth_gssapi_client error
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed May 9, 2024
1 parent 68028f1 commit 4ab7bb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/database/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ export async function createConnectionPool() {
} catch (err: any) {
isServerConnected = false;

const message = err.message.includes('auth_gssapi_client')
? `Server requests authentication using unknown plugin auth_gssapi_client.\nSee https://github.com/overextended/oxmysql/issues/213.`
: err.message;

console.log(
`^3Unable to establish a connection to the database (${err.code})!\n^1Error ${err.errno}: ${err.message}^0`
`^3Unable to establish a connection to the database (${err.code})!\n^1Error${
err.errno ? ` ${err.errno}` : ''
}: ${message}^0`
);
}
}
Expand Down

0 comments on commit 4ab7bb7

Please sign in to comment.