Skip to content

Commit 603884a

Browse files
committed
Merge pull request #72 from netresearch/invalid-schema-path-info
show path info in invalid-schema exception
2 parents d37f896 + 45d63a3 commit 603884a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/JsonSchema/Constraints/Undefined.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ public function check($value, $schema = null, $path = null, $i = null)
3030
}
3131

3232
if (!is_object($schema)) {
33-
throw new InvalidArgumentException('Given schema must be an object.');
33+
throw new InvalidArgumentException(
34+
'Given schema must be an object in ' . $path
35+
. ' but is a ' . gettype($schema)
36+
);
3437
}
3538

3639
$i = is_null($i) ? "" : $i;

0 commit comments

Comments
 (0)