From ba60a863b25fca861340c2a2185e250f5e67d757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20L=C3=BCbbemeier?= Date: Sun, 4 Mar 2018 13:39:01 +0100 Subject: [PATCH] Don't crash on error setting autocmd --- src/subscriptions.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/subscriptions.rs b/src/subscriptions.rs index 91f45f9..40b7629 100644 --- a/src/subscriptions.rs +++ b/src/subscriptions.rs @@ -96,7 +96,9 @@ impl Subscriptions { nvim.command(&format!( "au {} * call rpcnotify(1, 'subscription', '{}', {} {})", event_name, event_name, i, args, - )).expect("Could not set autocmd"); + )).unwrap_or_else(|err| { + error!("Could not set autocmd: {}", err); + }); } } }