Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.

Commit 4af4246

Browse files
author
Ben Buckman
committed
include ValidatorError message in ValidationError. fixes Automattic#2135.
1 parent f2dd3d5 commit 4af4246

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/document.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,10 @@ Document.prototype.validate = function (cb) {
10301030
Document.prototype.invalidate = function (path, err, val) {
10311031
if (!this.$__.validationError) {
10321032
this.$__.validationError = new ValidationError(this);
1033+
1034+
if (err instanceof ValidatorError) {
1035+
this.$__.validationError.message += ': ' + err.toString();
1036+
}
10331037
}
10341038

10351039
if (!err || 'string' === typeof err) {

0 commit comments

Comments
 (0)