Skip to content

Commit aefe1d0

Browse files
author
Michael O'Brien
committed
DEV: improve error messages
1 parent 7558e74 commit aefe1d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Model.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ export class Model {
10441044
return properties
10451045
}
10461046
if (op != 'scan' && this.getHash(rec, this.block.fields, index, params) == null) {
1047-
this.table.log.error(`Empty hash key`, {properties, params, op, rec, model: this.name})
1047+
this.table.log.error(`Empty hash key`, {properties, params, op, rec, index, model: this.name})
10481048
throw new OneTableError(`Empty hash key. Check hash key and any value template variable references.`, {
10491049
properties, rec, code: 'MissingError',
10501050
})
@@ -1165,7 +1165,7 @@ export class Model {
11651165
// Missing sort key on a high-level API for get/delete
11661166
if (properties[name] == null && attribute == index.sort && params.high && KeysOnly[op]) {
11671167
if (op == 'delete' && !params.many) {
1168-
throw new OneTableError('Missing sort key', {code: 'MissingError'})
1168+
throw new OneTableError('Missing sort key', {code: 'MissingError', properties, params})
11691169
}
11701170
/*
11711171
Missing sort key for high level get, or delete without "any".

0 commit comments

Comments
 (0)