From 4c0191b69023167dba27830904ea6503f248f858 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 27 Oct 2023 11:48:07 +0100 Subject: [PATCH] Bug 35173: Correctly concat error strings This patch moves the call to $sftp->error outside of the double quote string and into a . concat to properly expose the error message as apposed to outputting 'Net::SFTP::Foreign=HASH(0x559c9118f0c8)->error' Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall (cherry picked from commit 43bd124f873ac118a9f87a5b5160ee99dc8b8a47) Signed-off-by: Fridolin Somers --- Koha/Edifact/Transport.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm index b423eebc37..c0ae452ef9 100644 --- a/Koha/Edifact/Transport.pm +++ b/Koha/Edifact/Transport.pm @@ -148,10 +148,10 @@ sub sftp_download { } $sftp->setcwd( $self->{account}->download_directory ) or return $self->_abort_download( $sftp, - "Cannot change remote dir : $sftp->error" ); + "Cannot change remote dir: " . $sftp->error ); my $file_list = $sftp->ls() or return $self->_abort_download( $sftp, - "cannot get file list from server: $sftp->error" ); + "cannot get file list from server: " . $sftp->error ); foreach my $file ( @{$file_list} ) { my $filename = $file->{filename}; @@ -159,7 +159,7 @@ sub sftp_download { $sftp->get( $filename, "$self->{working_dir}/$filename" ); if ( $sftp->error ) { $self->_abort_download( $sftp, - "Error retrieving $filename: $sftp->error" ); + "Error retrieving $filename: " . $sftp->error ); last; } push @downloaded_files, $filename; @@ -170,7 +170,7 @@ sub sftp_download { my $ret = $sftp->rename( $filename, $processed_name ); if ( !$ret ) { $self->_abort_download( $sftp, - "Error renaming $filename: $sftp->error" ); + "Error renaming $filename: " . $sftp->error ); last; } @@ -302,7 +302,7 @@ sub sftp_upload { $sftp->die_on_error("Cannot ssh to $self->{account}->host"); $sftp->setcwd( $self->{account}->upload_directory ) or return $self->_abort_download( $sftp, - "Cannot change remote dir : $sftp->error" ); + "Cannot change remote dir : " . $sftp->error ); foreach my $m (@messages) { my $content = $m->raw_msg; if ($content) { -- 2.39.5