From 4ab7bb7a1073aeb0daf1b85031953c576dc0ce80 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Thu, 9 May 2024 11:18:11 +1000 Subject: [PATCH] refactor(db/connection): additional info for auth_gssapi_client error --- src/database/connection.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/database/connection.ts b/src/database/connection.ts index af0a420..e5e3145 100644 --- a/src/database/connection.ts +++ b/src/database/connection.ts @@ -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` ); } }