|
Lines 183-191
sub add {
Link Here
|
| 183 |
openapi => { error => "Given " . $to_api_mapping->{ $_->broken_fk } . " does not exist" } |
183 |
openapi => { error => "Given " . $to_api_mapping->{ $_->broken_fk } . " does not exist" } |
| 184 |
); |
184 |
); |
| 185 |
} elsif ( $_->isa('Koha::Exceptions::BadParameter') ) { |
185 |
} elsif ( $_->isa('Koha::Exceptions::BadParameter') ) { |
|
|
186 |
my $parameter = $to_api_mapping->{ $_->parameter } || $_->parameter; |
| 187 |
my $error = |
| 188 |
$parameter ? "Given " . $to_api_mapping->{ $_->parameter } . " does not exist" : $_->full_message; |
| 186 |
return $c->render( |
189 |
return $c->render( |
| 187 |
status => 400, |
190 |
status => 400, |
| 188 |
openapi => { error => "Given " . $to_api_mapping->{ $_->parameter } . " does not exist" } |
191 |
openapi => { error => $error } |
| 189 |
); |
192 |
); |
| 190 |
} elsif ( $_->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) { |
193 |
} elsif ( $_->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) { |
| 191 |
return $c->render( |
194 |
return $c->render( |
| 192 |
- |
|
|