Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 25766
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.07
Fixed in: (no value)



Subject: FIX: make JSONRPC catch and report exceptions properly.
What sub handle_method needs is an eval to catch eventual errors. I added it. See the new sub handle_method below: sub handle_method { my ($self, $r) = @_; my ($method,$params) = $self->get_request_data(); if( my $func = $self->find_method($method, $r) ){ my $result = eval { $func->($self,@$params); }; if ($@) { $self->set_err($@); } else { $self->set_response_data($result); } } else{ $self->set_err("Method '$method' not found."); } }
Please try JSON::RPC. Thanks,