handle null query in error log

This commit is contained in:
Mononaut 2023-11-14 05:52:27 +00:00
parent 08b68ef8ba
commit 29cbdf6cd5
No known key found for this signature in database
GPG key ID: A3F058E41374C04E

View file

@ -55,7 +55,7 @@ import { execSync } from 'child_process';
}).then(result => {
resolve(result);
}).catch(error => {
logger.debug(`database query "${query.slice(0, 100)}" failed!`);
logger.debug(`database query "${query?.slice(0, 100)}" failed!`);
reject(error);
}).finally(() => {
clearTimeout(timer);
@ -66,7 +66,7 @@ import { execSync } from 'child_process';
const pool = await this.getPool();
return pool.query(query, params);
} catch (e) {
logger.debug(`database query "${query.slice(0, 100)}" failed!`);
logger.debug(`database query "${query?.slice(0, 100)}" failed!`);
throw e;
}
}