summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2020-01-25 16:11:18 +0000
committerdakkar <dakkar@thenautilus.net>2020-01-25 16:11:18 +0000
commitff33ea3a4844e322a53cac7d24ce408fff38ec22 (patch)
tree05ef119731cad0bae4a35a8494a7c3b701dcb72f /lib
parentspeed-up Bayes predictions (diff)
downloadMaildirIndexer-ff33ea3a4844e322a53cac7d24ce408fff38ec22.tar.gz
MaildirIndexer-ff33ea3a4844e322a53cac7d24ce408fff38ec22.tar.bz2
MaildirIndexer-ff33ea3a4844e322a53cac7d24ce408fff38ec22.zip
don't die if the other end closes the socket
Diffstat (limited to 'lib')
-rw-r--r--lib/MaildirIndexer/Server.rakumod7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/MaildirIndexer/Server.rakumod b/lib/MaildirIndexer/Server.rakumod
index 07dfb4a..b1b2016 100644
--- a/lib/MaildirIndexer/Server.rakumod
+++ b/lib/MaildirIndexer/Server.rakumod
@@ -25,6 +25,13 @@ method serve() {
with parse-email($conn) -> $email {
with $.store.mailbox-for-email($email) -> $mailbox {
await $conn.print("$mailbox\x0d\x0a");
+ # apparently socket failures ("broken pipe",
+ # "Cannot write to a closed socket") are
+ # X::AdHoc
+ CATCH {
+ when X::OS { }; when X::AdHoc { };
+ default { .rethrow }
+ }
}
}
}