Skip Menu |

This queue is for tickets about the CatalystX-ExtJS CPAN distribution.

Report information
The Basics
Id: 60396
Status: resolved
Priority: 0/
Queue: CatalystX-ExtJS

People
Owner: Nobody in particular
Requestors: mail [...] herbert-leitz.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.101700
Fixed in: (no value)



Subject: DBIC errors are not propagated [PATCH]
Hi, in CatalystX::Controller::ExtJS::Direct::API, errors from DBIC are not propagated to ExtJS. This patch looks for errors in $c->error after the call to $c->visit() and - if present - copies the error messages to the ExtJS exception object. Best Regards Herbert
Subject: dbic_errors.patch
--- lib/CatalystX/Controller/ExtJS/Direct/API.pm 2010-06-19 11:56:23.000000000 +0200 +++ lib/CatalystX/Controller/ExtJS/Direct/newAPI.pm 2010-08-16 18:25:09.610728598 +0200 @@ -139,6 +139,7 @@ sub router { local $c->{response} = $c->response_class->new({}); local $c->{stash} = {}; local $c->{request} = $c->req; + local $c->{error} = undef; $c->req->parameters($params); $c->req->body_parameters($params); @@ -156,7 +157,14 @@ sub router { $body = $response->body; } } or do { - push(@res, { type => 'exception', tid => $req->{tid}, message => "$@".$c->response->body }); + my $msg; + if(scalar @{ $c->error }){ + $msg = join "\n", @{ $c->error }; + } + else{ + $msg = "$@".$c->response->body; + } + push(@res, { type => 'exception', tid => $req->{tid}, message => $msg }); next REQUESTS; };
Thanks. Fixed in 1.12