mirror of
https://github.com/mempool/mempool.git
synced 2025-01-18 21:32:55 +01:00
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 => {
|
||||
resolve(result);
|
||||
}).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);
|
||||
}).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?.sql?.slice(0, 160) || (typeof(query) === 'string' || query instanceof String ? query?.slice(0, 160) : 'unknown query')}" failed!`);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user