View | Details | Raw Unified | Return to bug 27806
Collapse All | Expand All

(-)a/Koha/REST/Plugin/Exceptions.pm (-6 / +10 lines)
Lines 54-69 sub register { Link Here
54
    $app->helper(
54
    $app->helper(
55
        'unhandled_exception' => sub {
55
        'unhandled_exception' => sub {
56
            my ( $c, $exception ) = @_;
56
            my ( $c, $exception ) = @_;
57
            warn "Inside unhandled_exception\n";
57
58
58
            my $req    = $c->req;
59
            my $method = $req->method;
60
            my $path   = $req->url->to_abs->path;
61
            my $type = "";
59
            my $type = "";
62
63
            if ( blessed $exception ) {
60
            if ( blessed $exception ) {
64
                $type = "(" . ref($exception) . ")";
61
                if ( $exception->isa('Koha::Exceptions::Object::PropertyNotFound') ) {
62
                    $c->render( status => 400, json => $_->error );
63
                } else {
64
                    $type = "(" . ref($exception) . ")";
65
                }
65
            }
66
            }
66
67
68
            my $req    = $c->req;
69
            my $method = $req->method;
70
            my $path   = $req->url->to_abs->path;
71
67
            my $exception_string = "$exception";
72
            my $exception_string = "$exception";
68
            chomp($exception_string);
73
            chomp($exception_string);
69
74
70
- 

Return to bug 27806