Skip to content

Commit

Permalink
tweak: Adjust error message to be more explicit about what can pass
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Nov 17, 2015
1 parent 7b12722 commit 3ced29a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function DefaultValidators() {
return this.assert(!data || data instanceof MongoDB.ObjectID || (data._bsontype === 'ObjectID' && data.id));
}, { name: 'ObjectID validation' }),
Skmatc.create(schema => schema === Buffer, function(schema, data) {
return this.assert(data && (data instanceof MongoDB.Binary || (data._bsontype === 'Binary' && data.buffer)), "Expected " + JSON.stringify(data) + " to be a valid buffer or MongoDB.Binary object");
return this.assert(data && (data instanceof MongoDB.Binary || (data._bsontype === 'Binary' && data.buffer)), "Expected " + JSON.stringify(data) + " to be a valid MongoDB.Binary object");
}, { name: 'Buffer validation' })
];
}

0 comments on commit 3ced29a

Please sign in to comment.