DOKK / manpages / debian 10 / libjson-validator-perl / JSON::Validator::Error.3pm.en
JSON::Validator::Error(3pm) User Contributed Perl Documentation JSON::Validator::Error(3pm)

JSON::Validator::Error - JSON::Validator error object

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

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

  my $str = $error->message;

A human readable description of the error. Defaults to empty string.

  my $str = $error->path;

A JSON pointer to where the error occurred. Defaults to "/".

  my $error = JSON::Validator::Error->new($path, $message);

Object constructor.

  my $str = $error->to_string;

Returns the "path" and "message" part as a string: "$path: $message".

JSON::Validator::Error overloads the following operators:

  my $bool = !!$error;

Always true.

  my $str = "$error";

Alias for "to_string".

JSON::Validator.

2019-02-15 perl v5.28.1