table of contents
JSON::Validator::Error(3pm) | User Contributed Perl Documentation | JSON::Validator::Error(3pm) |
NAME¶
JSON::Validator::Error - JSON::Validator error objectSYNOPSIS¶
use JSON::Validator::Error; my $err = JSON::Validator::Error->new($path, $message);
DESCRIPTION¶
JSON::Validator::Error is a class representing validation errors from JSON::Validator.ATTRIBUTES¶
message¶
my $str = $error->message;
A human readable description of the error. Defaults to empty string.
path¶
my $str = $error->path;
A JSON pointer to where the error occurred. Defaults to "/".
METHODS¶
new¶
my $error = JSON::Validator::Error->new($path, $message);
Object constructor.
to_string¶
my $str = $error->to_string;
Returns the "path" and "message" part as a string: "$path: $message".
OPERATORS¶
JSON::Validator::Error overloads the following operators:bool¶
my $bool = !!$error;
Always true.
stringify¶
my $str = "$error";
Alias for "to_string".
SEE ALSO¶
JSON::Validator.2019-02-15 | perl v5.28.1 |