forked from jshirley/catalyst-action-rest
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'hobbs/rework-serializer-return-2'
* hobbs/rework-serializer-return-2: Add tests for Serialize::View error behavior Add some real error-handling for Serialize::View View is halfway there. Do we want to poke in $c->error? Maybe not. Port Serialize classes except for View. Change Serialize::execute to expect serializers to throw an exception
- Loading branch information
Showing
9 changed files
with
61 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package Test::Serialize::View::Awful; | ||
|
||
use base Catalyst::View; | ||
|
||
sub render { | ||
my ($self, $c, $template) = @_; | ||
die "I don't know how to do that!"; | ||
} | ||
|
||
sub process { | ||
my ($self, $c) = @_; | ||
|
||
my $output = eval { | ||
$self->render($c, "blah"); | ||
}; | ||
|
||
if ($@) { | ||
my $error = qq/Couldn't render template. Error: "$@"/; | ||
$c->error($error); | ||
return 0; | ||
} | ||
|
||
$c->res->body($output); | ||
return 1; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters