- if ( not defined $city ) {
- return $c->$cb( { error => "Object not found" }, 404 );
- }
- elsif ( $_->isa('Koha::Exceptions::Object') ) {
- return $c->$cb( { error => $_->message }, 500 );
- }
- else {
- return $c->$cb(
- { error => "Something went wrong, check the logs." }, 500 );
- }