1JSON::Validator::Error(U3s)er Contributed Perl DocumentatJiSoOnN::Validator::Error(3)
2
3
4
6 JSON::Validator::Error - JSON::Validator error object
7
9 use JSON::Validator::Error;
10 my $err = JSON::Validator::Error->new($path, $message);
11
13 JSON::Validator::Error is a class representing validation errors from
14 JSON::Validator.
15
17 message
18 my $str = $error->message;
19
20 A human readable description of the error. Defaults to empty string.
21
22 path
23 my $str = $error->path;
24
25 A JSON pointer to where the error occurred. Defaults to "/".
26
28 new
29 my $error = JSON::Validator::Error->new($path, $message);
30
31 Object constructor.
32
33 to_string
34 my $str = $error->to_string;
35
36 Returns the "path" and "message" part as a string: "$path: $message".
37
39 JSON::Validator::Error overloads the following operators:
40
41 bool
42 my $bool = !!$error;
43
44 Always true.
45
46 stringify
47 my $str = "$error";
48
49 Alias for "to_string".
50
52 JSON::Validator.
53
54
55
56perl v5.30.0 2019-08-11 JSON::Validator::Error(3)