- this.logger[queryLogLevel](_fileScope('pgp:query'), '', { ...common.pick(event, ['query', 'params']) });
+ this.logger[queryLogLevel](_fileScope('pgp:query'), '', { ...common.pick(event || {}, ['query', 'params']) });
const exemplaryRow = data[0];
for (const prop in exemplaryRow) {
const camel = Database._camelfy(prop);
const exemplaryRow = data[0];
for (const prop in exemplaryRow) {
const camel = Database._camelfy(prop);
- const resultLog = common.pick(result, ['command', 'rowCount', 'duration']);
+ const resultLog = common.pick(result || {}, ['command', 'rowCount', 'duration']);
this.logger[queryLogLevel](_fileScope('pgp:result'), '', { query: event.query, ...resultLog });
}
};
this.logger[queryLogLevel](_fileScope('pgp:result'), '', { query: event.query, ...resultLog });
}
};
- this.logger.error(_scope, 'failed', { error: e, identifier, scrubbedCredential })
+ this.logger.error(_scope, 'failed', { error: e, identifier, scrubbedCredential });
const _scope = _fileScope('topicGetByUrl');
this.logger.debug(_scope, 'called', { topicUrl });
let topic;
try {
topic = await dbCtx.oneOrNone(this.statement.topicGetByUrl, { topicUrl });
const _scope = _fileScope('topicGetByUrl');
this.logger.debug(_scope, 'called', { topicUrl });
let topic;
try {
topic = await dbCtx.oneOrNone(this.statement.topicGetByUrl, { topicUrl });
} catch (e) {
this.logger.error(_scope, 'failed', { error: e, topic, topicUrl });
throw e;
} catch (e) {
this.logger.error(_scope, 'failed', { error: e, topic, topicUrl });
throw e;