- 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;
const events = await dbCtx.manyOrNone(this.statement.topicPublishHistory, { topicIds: [topicId], daysAgo: days });
const history = Array.from({ length: days }, () => 0);
const events = await dbCtx.manyOrNone(this.statement.topicPublishHistory, { topicIds: [topicId], daysAgo: days });
const history = Array.from({ length: days }, () => 0);
- result = await dbCtx.result(this.statement.topicSetContentHistory, { topicId: data.topicId, contentHash: data.contentHash, contentSize: data.content.length });
+ result = await dbCtx.result(this.statement.topicSetContentHistory, {
+ topicId: data.topicId,
+ contentHash: data.contentHash,
+ contentSize: data.content.length,
+ });
if (result.rowCount != 1) {
throw new DBErrors.UnexpectedResult('did not set topic content history');
}
if (result.rowCount != 1) {
throw new DBErrors.UnexpectedResult('did not set topic content history');
}