Lines 20-25
use Modern::Perl;
Link Here
|
20 |
use Mojo::Base 'Mojolicious'; |
20 |
use Mojo::Base 'Mojolicious'; |
21 |
|
21 |
|
22 |
use C4::Context; |
22 |
use C4::Context; |
|
|
23 |
use Koha::Logger; |
23 |
use Carp; |
24 |
use Carp; |
24 |
use JSON::Validator::OpenAPI::Mojolicious; |
25 |
use JSON::Validator::OpenAPI::Mojolicious; |
25 |
use Try::Tiny; |
26 |
use Try::Tiny; |
Lines 106-112
sub startup {
Link Here
|
106 |
# to catch bad ones. |
107 |
# to catch bad ones. |
107 |
|
108 |
|
108 |
# JSON::Validator uses confess, so trim call stack from the message. |
109 |
# JSON::Validator uses confess, so trim call stack from the message. |
109 |
carp "Warning: Could not load REST API spec bundle: " . ($_ =~ /\A(.*?)$/ms)[0]; |
110 |
my $logger = Koha::Logger->get({ interface => 'api' }); |
|
|
111 |
$logger->error("Warning: Could not load REST API spec bundle: " . $_); |
110 |
|
112 |
|
111 |
try { |
113 |
try { |
112 |
$validator->load_and_validate_schema( |
114 |
$validator->load_and_validate_schema( |
Lines 138-144
sub startup {
Link Here
|
138 |
} |
140 |
} |
139 |
catch { |
141 |
catch { |
140 |
# JSON::Validator uses confess, so trim call stack from the message. |
142 |
# JSON::Validator uses confess, so trim call stack from the message. |
141 |
croak "Could not load REST API spec: " . ($_ =~ /\A(.*?)$/ms)[0]; |
143 |
$logger->error("Warning: Could not load REST API spec bundle: " . $_); |
142 |
}; |
144 |
}; |
143 |
}; |
145 |
}; |
144 |
|
146 |
|
145 |
- |
|
|