diff options
Diffstat (limited to 'lib/App')
-rw-r--r-- | lib/App/MediaControl.rakumod | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/App/MediaControl.rakumod b/lib/App/MediaControl.rakumod index f60f3c7..238ae53 100644 --- a/lib/App/MediaControl.rakumod +++ b/lib/App/MediaControl.rakumod @@ -24,6 +24,16 @@ class App::MediaControl { my $status = await self.vlc.status(); content 'application/json', $status; } + + around -> &handler { + handler(); + CATCH { + default { + response.status = 500; + content 'application/json', %( error => "$_" ); + } + } + } }; $!service = Cro::HTTP::Server.new( |