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;
8
8
use OpenQA::App;
9
9
use OpenQA::Utils qw( :DEFAULT href_to_bugref) ;
10
10
use List::Util qw( min) ;
11
+ use Feature::Compat::Try;
11
12
12
13
=pod
13
14
@@ -138,8 +139,9 @@ sub create ($self) {
138
139
user_id => $self -> current_user-> id
139
140
});
140
141
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
+
143
145
$self -> emit_event(' openqa_comment_create' , $comment -> event_data);
144
146
$txn_guard -> commit;
145
147
$self -> render(json => {id => $comment -> id});
You can’t perform that action at this time.
0 commit comments