From 0d7b80cf89dabdc8f62f658c817e21c2f6372fa9 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 --- 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 b423eebc374..c0ae452ef98 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.30.2