summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-11-12 01:07:23 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-11-12 01:07:23 +0100
commit1884b461e52b31ff26af8f7739ba1919d12d016c (patch)
treea946165913e0bef429786972cb947800da9b1847 /lib
parentc75c68b0dd35610e9e22e369d0ef1981584f73c3 (diff)
downloadApp-BorgRestore-1884b461e52b31ff26af8f7739ba1919d12d016c.tar.gz
App-BorgRestore-1884b461e52b31ff26af8f7739ba1919d12d016c.tar.xz
Remove duplicate exception strings
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/App/BorgRestore.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm
index 6efac2c..edc009c 100644
--- a/lib/App/BorgRestore.pm
+++ b/lib/App/BorgRestore.pm
@@ -195,8 +195,7 @@ method find_archives($path) {
}
if (!@ret) {
- $log->errorf("Path '%s' not found in any archive.\n", $path);
- die "Failed to find archives for path\n";
+ die $log->errorf("Path '%s' not found in any archive.", $path)."\n";
}
@ret = sort { $a->{modification_time} <=> $b->{modification_time} } @ret;
@@ -228,8 +227,7 @@ method get_all_archives() {
}
if (!@ret) {
- $log->errorf("No archives found.\n");
- die "No archives found.\n";
+ die $log->error("No archives found.")."\n";
}
@ret = sort { $a->{modification_time} <=> $b->{modification_time} } @ret;
@@ -252,8 +250,7 @@ s (seconds), min (minutes), h (hours), d (days), m (months = 31 days), y (year).
method select_archive_timespec($archives, $timespec) {
my $seconds = $self->_timespec_to_seconds($timespec);
if (!defined($seconds)) {
- $log->errorf("Invalid time specification: %s", $timespec);
- croak "Invalid time specification";
+ croak $log->errorf("Invalid time specification: %s", $timespec);
}
my $target_timestamp = time - $seconds;
@@ -267,7 +264,7 @@ method select_archive_timespec($archives, $timespec) {
}
}
- die "Failed to find archive matching time specification\n";
+ die $log->error("Failed to find archive matching time specification")."\n";
}
method _timespec_to_seconds($timespec) {