use a simple eval
This commit is contained in:
parent
64b3a06edf
commit
2e684886f7
@ -8,8 +8,6 @@ use Dancer2::Plugin::JsonApi::Registry;
|
||||
use Dancer2::Plugin;
|
||||
use Dancer2::Serializer::JsonApi;
|
||||
|
||||
use experimental qw/ try /;
|
||||
|
||||
has registry => (
|
||||
plugin_keyword => 'jsonapi_registry',
|
||||
is => 'ro',
|
||||
@ -33,9 +31,8 @@ sub jsonapi : PluginKeyword ( $plugin, $type, $sub ) {
|
||||
}
|
||||
|
||||
sub BUILD ( $self, @ ) {
|
||||
my $serializer = do {
|
||||
try { $self->app->serializer_engine } catch ($e) {
|
||||
}
|
||||
my $serializer = eval {
|
||||
$self->app->serializer_engine
|
||||
};
|
||||
|
||||
unless ($serializer) {
|
||||
|
Loading…
Reference in New Issue
Block a user