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 102-110
sub startup {
Link Here
|
102 |
catch { |
103 |
catch { |
103 |
# Validation of the complete spec failed. Resort to validation one-by-one |
104 |
# Validation of the complete spec failed. Resort to validation one-by-one |
104 |
# to catch bad ones. |
105 |
# to catch bad ones. |
105 |
|
106 |
|
106 |
# JSON::Validator uses confess, so trim call stack from the message. |
107 |
# JSON::Validator uses confess, so trim call stack from the message. |
107 |
carp "Warning: Could not load REST API spec bundle: " . ($_ =~ /\A(.*?)$/ms)[0]; |
108 |
my $logger = Koha::Logger->get({ interface => 'api' }); |
|
|
109 |
$logger->error("Warning: Could not load REST API spec bundle: " . $_); |
108 |
|
110 |
|
109 |
try { |
111 |
try { |
110 |
$validator->load_and_validate_schema( |
112 |
$validator->load_and_validate_schema( |
Lines 135-141
sub startup {
Link Here
|
135 |
} |
137 |
} |
136 |
catch { |
138 |
catch { |
137 |
# JSON::Validator uses confess, so trim call stack from the message. |
139 |
# JSON::Validator uses confess, so trim call stack from the message. |
138 |
croak "Could not load REST API spec: " . ($_ =~ /\A(.*?)$/ms)[0]; |
140 |
$logger->error("Warning: Could not load REST API spec bundle: " . $_); |
139 |
}; |
141 |
}; |
140 |
}; |
142 |
}; |
141 |
|
143 |
|
142 |
- |
|
|