handle unknown query types in db error log
This commit is contained in:
parent
29cbdf6cd5
commit
5c0a59d2f6
@ -55,7 +55,7 @@ import { execSync } from 'child_process';
|
|||||||
}).then(result => {
|
}).then(result => {
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
logger.debug(`database query "${query?.slice(0, 100)}" failed!`);
|
logger.debug(`database query "${query?.sql?.slice(0, 160) || (typeof(query) === 'string' || query instanceof String ? query?.slice(0, 160) : 'unknown query')}" failed!`);
|
||||||
reject(error);
|
reject(error);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
@ -66,7 +66,7 @@ import { execSync } from 'child_process';
|
|||||||
const pool = await this.getPool();
|
const pool = await this.getPool();
|
||||||
return pool.query(query, params);
|
return pool.query(query, params);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.debug(`database query "${query?.slice(0, 100)}" failed!`);
|
logger.debug(`database query "${query?.sql?.slice(0, 160) || (typeof(query) === 'string' || query instanceof String ? query?.slice(0, 160) : 'unknown query')}" failed!`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user