1JSON::Validator::Error(U3s)er Contributed Perl DocumentatJiSoOnN::Validator::Error(3)
2
3
4

NAME

6       JSON::Validator::Error - JSON::Validator error object
7

SYNOPSIS

9         use JSON::Validator::Error;
10         my $err = JSON::Validator::Error->new($path, $message);
11

DESCRIPTION

13       JSON::Validator::Error is a class representing validation errors from
14       JSON::Validator.
15

ATTRIBUTES

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

METHODS

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

OPERATORS

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

SEE ALSO

52       JSON::Validator.
53
54
55
56perl v5.28.1                      2019-01-30         JSON::Validator::Error(3)
Impressum