@@ -, +, @@ --- Koha/REST/Plugin/Objects.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/Koha/REST/Plugin/Objects.pm +++ a/Koha/REST/Plugin/Objects.pm @@ -18,6 +18,7 @@ package Koha::REST::Plugin::Objects; use Modern::Perl; use Mojo::Base 'Mojolicious::Plugin'; +use Try::Tiny; use JSON; @@ -114,7 +115,11 @@ sub register { } # Perform search my $objects = $result_set->search( $filtered_params, $attributes ); - my $total = $result_set->search->count; + my $total = try { + $result_set->search->count; + } catch { + warn "Caught in REST Plugin\n"; + }; $c->add_pagination_headers( { --