Skip to content

Commit 251c043

Browse files
committed
[BUG] Those changes make the t/ui/15-comments.t fail
1 parent c003485 commit 251c043

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +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-
12-
=pod
11+
use Feature::Compat::Try=pod
1312

1413
=head1 NAME
1514
@@ -138,8 +137,9 @@ sub create ($self) {
138137
user_id => $self->current_user->id
139138
});
140139

141-
eval { $comment->handle_special_contents($self) };
142-
return $self->render(json => {error => $@}, status => 400) if $@;
140+
try { $comment->handle_special_contents($self) }
141+
catch ($e) { return $self->render(json => {error => $e}, status => 400) }
142+
143143
$self->emit_event('openqa_comment_create', $comment->event_data);
144144
$txn_guard->commit;
145145
$self->render(json => {id => $comment->id});

0 commit comments

Comments
 (0)