File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ Template::Plugin::JSON = 0
4040Template::Plugin::Markdown = 0
4141Template::Plugin::Number::Format = 0
4242Template::Plugin::Page = 0
43+ Try::Tiny = 0.09
4344XML::Feed = 0
4445[Prereqs / TestRequires]
4546Test::More = 0.96
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ use Encode ();
99use Test::More;
1010use JSON;
1111use AnyEvent::HTTP qw( http_request) ;
12+ use Try::Tiny 0.09;
13+ use namespace::autoclean;
1214
1315{
1416 no warnings ' once' ;
@@ -87,12 +89,13 @@ sub raw_api_response {
8789
8890 # we have to assume an encoding; doing nothing is like assuming latin1
8991 # we'll probably have the least number of issues if we assume utf8
90- local $@ ;
91- eval {
92+ try {
9293 # decode so the template doesn't double-encode and return mojibake
9394 $data &&= $encoding -> decode( $data , $encode_check );
95+ }
96+ catch {
97+ warn $_ [0];
9498 };
95- warn $@ if $@ ;
9699
97100 return +{ raw => $data };
98101}
You can’t perform that action at this time.
0 commit comments