Permalink
Browse files

Set an 'on_error' handler to NaMatrix so that server failures (e.g. 5…

…00 ISE) don't become process-wide fatal
1 parent ec23320 commit 9481da67b87c1d5142dbc76d9e4b6eb29c56398b @leonerd leonerd committed Feb 16, 2017
Showing with 5 additions and 0 deletions.
  1. +5 −0 mon.pl
View
@@ -44,6 +44,11 @@
my $matrix = Net::Async::Matrix->new(
server => $CONFIG->{homeserver},
+ # Just warn so errors don't become fatal to the process
+ on_error => sub {
+ my ( undef, $message ) = @_;
+ warn "NaMatrix failure: $message\n";
+ },
);
$loop->add( $matrix );

0 comments on commit 9481da6

Please sign in to comment.