Skip to content

Commit 3c0c163

Browse files
committed
[BUG] Those changes make the t/ui/15-comments.t fail
1 parent 20f899c commit 3c0c163

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/OpenQA/WebAPI/Controller/API/V1/Comment.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use Date::Format;
88
use OpenQA::App;
99
use OpenQA::Utils qw(:DEFAULT href_to_bugref);
1010
use 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});

0 commit comments

Comments
 (0)