mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Proper error message for undefined where options (#1022)
When user provides a knex select statement with an undefined options in where clause it is not properly handled an give an ambiguous error message telling `Unhandled rejection TypeError: Cannot read property 'toString' of undefined.` This PR will helpful to users at it will tell them the exact problem.
This commit is contained in:
parent
edf4e7f76c
commit
667953fd5c
@ -48,6 +48,9 @@ var prepareValue = function(val, seen) {
|
||||
if(typeof val === 'object') {
|
||||
return prepareObject(val, seen);
|
||||
}
|
||||
if (typeof val === 'undefined') {
|
||||
throw new Error('SQL queries with undefined where clause option');
|
||||
}
|
||||
return val.toString();
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user