diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-04-02 13:54:27 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-04-02 13:54:27 +0200 |
commit | ab037ebb9332f30d806b2c2ed2ffff55c1874709 (patch) | |
tree | 5f5e936b9d0e3c9bb1015a78da262bdb4879253a | |
parent | 1c654d9c6494dcd929efdc6f8203a32c7860dfc2 (diff) | |
download | App-BorgRestore-ab037ebb9332f30d806b2c2ed2ffff55c1874709.tar.gz App-BorgRestore-ab037ebb9332f30d806b2c2ed2ffff55c1874709.tar.xz |
Use Carp for path resolving error
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | lib/App/BorgRestore.pm | 3 | ||||
-rwxr-xr-x | 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); |