From 084471fd4f199ed9bb10eb1b8a423d7ec50f9701 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sat, 12 Jan 2008 11:19:11 +0100 Subject: [PATCH] - Add feedback for /videosite save --- videosite.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/videosite.pl b/videosite.pl index 847e627..0c5b650 100644 --- a/videosite.pl +++ b/videosite.pl @@ -96,9 +96,16 @@ sub check_for_link { sub cmd_save { - open(CONF, '>'.$conffile); - print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}); - close(CONF); + eval { + open(CONF, '>'.$conffile) or die 'Could not open config file'; + print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}); + close(CONF); + }; + if ($@) { + write_irssi(undef, 'Could not save config: %s', $@); + } else { + write_irssi(undef, 'Saved config'); + } } sub cmd_set { -- 1.8.3.1