From ab037ebb9332f30d806b2c2ed2ffff55c1874709 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 2 Apr 2017 13:54:27 +0200 Subject: Use Carp for path resolving error Signed-off-by: Florian Pritz --- lib/App/BorgRestore.pm | 3 ++- script/borg-restore.pl | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index 4891ec9..0c61312 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -11,6 +11,7 @@ use App::BorgRestore::Helper; use App::BorgRestore::Settings; use autodie; +use Carp; use Cwd qw(abs_path getcwd); use File::Basename; use File::Slurp; @@ -114,7 +115,7 @@ sub resolve_relative_path { if (!defined($abs_path)) { $log->fatalf("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."); - return; + croak "Path resolving failed"; } return $abs_path; diff --git a/script/borg-restore.pl b/script/borg-restore.pl index b30549f..1fdc758 100755 --- a/script/borg-restore.pl +++ b/script/borg-restore.pl @@ -260,7 +260,6 @@ sub main { } my $abs_path = $app->resolve_relative_path($path); - return 1 unless defined $abs_path; $destination = dirname($abs_path) unless defined($destination); my $backup_path = $app->map_path_to_backup_path($abs_path); -- cgit v1.2.3-24-g4f1b