summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-04-02 11:19:20 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-04-02 13:42:15 +0200
commit69164595e42dd8acd9db32c78298972ce29bebe6 (patch)
tree5e0284acfaf66c709d8ba73309a291200af82618
parent9310b39e245f94e09df2bb99a686c54e54203a9f (diff)
downloadApp-BorgRestore-69164595e42dd8acd9db32c78298972ce29bebe6.tar.gz
App-BorgRestore-69164595e42dd8acd9db32c78298972ce29bebe6.tar.xz
script: Print fatal errors using logger
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xscript/borg-restore.pl8
1 files changed, 4 insertions, 4 deletions
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;
}