From 69164595e42dd8acd9db32c78298972ce29bebe6 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 2 Apr 2017 11:19:20 +0200 Subject: script: Print fatal errors using logger Signed-off-by: Florian Pritz --- script/borg-restore.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/borg-restore.pl b/script/borg-restore.pl index 1834396..7843270 100755 --- a/script/borg-restore.pl +++ b/script/borg-restore.pl @@ -256,15 +256,15 @@ sub main { } if (@ARGV > 1) { - say STDERR "Error: Too many arguments"; + $log->fatal("Too many arguments"); exit(1); } my $canon_path = File::Spec->canonpath($path); my $abs_path = abs_path($canon_path); if (!defined($abs_path)) { - say STDERR "Error: Failed to resolve path to absolute path: $canon_path: $!"; - say STDERR "Make sure that all parts of the path, except the last one, exist."; + $log->fatal("Failed to resolve path to absolute path: %s: %s", $canon_path, $!); + $log->fatal("Make sure that all parts of the path, except the last one, exist."); exit(1); } @@ -292,7 +292,7 @@ sub main { } if (!defined($selected_archive)) { - say STDERR "Error: No archive selected or selection invalid"; + $log->fatal("No archive selected or selection invalid"); return 1; } -- cgit v1.2.3-24-g4f1b