File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
lib/OpenQA/WebAPI/Controller/API/V1 Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use Date::Format;
88use OpenQA::App;
99use OpenQA::Utils qw( :DEFAULT href_to_bugref) ;
1010use List::Util qw( min) ;
11+ use Feature::Compat::Try;
1112
1213=pod
1314
@@ -138,8 +139,9 @@ sub create ($self) {
138139 user_id => $self -> current_user-> id
139140 });
140141
141- eval { $comment -> handle_special_contents($self ) };
142- return $self -> render(json => {error => $@ }, status => 400) if $@ ;
142+ try { $comment -> handle_special_contents($self ) }
143+ catch ($e ) { return $self -> render(json => {error => $e }, status => 400) }
144+
143145 $self -> emit_event(' openqa_comment_create' , $comment -> event_data);
144146 $txn_guard -> commit;
145147 $self -> render(json => {id => $comment -> id});
You can’t perform that action at this time.
0 commit comments