diff --git a/lib/schema/uuid.js b/lib/schema/uuid.js index 41ab1f60e49..aa72c42107f 100644 --- a/lib/schema/uuid.js +++ b/lib/schema/uuid.js @@ -344,8 +344,15 @@ SchemaUUID.prototype.castForQuery = function($conditional, val, context) { if (!handler) throw new Error('Can\'t use ' + $conditional + ' with UUID.'); return handler.call(this, val, context); - } else { - return this.cast(val); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; } };