X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=blobdiff_plain;f=lib%2FCatalyst%2FController%2FDBIC%2FAPI.pm;h=bfd50242d957792d97cefe2ba513bbc78497a56c;hp=52202a0541876c187805b47b82b4b6b97a09fc0d;hb=7821bdec3826d11fe878d13859c15d7f2c5b0cfa;hpb=11ba2ccc06f22b028f66fdfcad72ce3903345374 diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index 52202a0..bfd5024 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -916,7 +916,14 @@ push_error stores an error message into the stash to be later retrieved by Lstash->{_dbic_crud_errors}}, $params->{message} || 'unknown error' ); + my $error = 'unknown error'; + if (exists $params->{message}) { + $error = $params->{message}; + # remove newline from die "error message\n" which is required to not + # have the filename and line number in the error text + $error =~ s/\n$//; + } + push( @{$c->stash->{_dbic_crud_errors}}, $error); } =method_protected get_errors