jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 57 forks source link

Unexpected error message for non-existant schema file #231

Closed perlpunk closed 3 years ago

perlpunk commented 3 years ago

Steps to reproduce the behavior

If the schema file is absolute, the error message is unexpected:

use JSON::Validator;
my $v = JSON::Validator->new;
$v = $v->load_and_validate_schema("/none");
__END__
Can't call method "server" on an undefined value at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/Server/Daemon.pm line 55.

Expected behavior

If the file is relative, the error message is as expected:

use JSON::Validator;
my $v = JSON::Validator->new;
$v = $v->load_and_validate_schema("none");
__END__
Unable to load schema none at /usr/lib/perl5/vendor_perl/5.26.1/JSON/Validator/Store.pm line 47.

This happens since version 4.10. 4.09 is ok.