Bugzilla – Attachment 188154 Details for
Bug 41020
Add ability to use file transports for MARC ordering accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41020: Standardize _abort_operation() signature in FTP transport
Bug-41020-Standardize-abortoperation-signature-in-.patch (text/plain), 2.59 KB, created by
Martin Renvoize (ashimema)
on 2025-10-20 11:37:56 UTC
(
hide
)
Description:
Bug 41020: Standardize _abort_operation() signature in FTP transport
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-20 11:37:56 UTC
Size:
2.59 KB
patch
obsolete
>From 612568742612333d260492a6f49ff867effc03d1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 16 Oct 2025 10:19:38 -0400 >Subject: [PATCH] Bug 41020: Standardize _abort_operation() signature in FTP > transport > >This patch updates Koha::File::Transport::FTP::_abort_operation() to >accept an optional $path parameter, matching the signature used in >Koha::File::Transport::SFTP. > >This improves error reporting by including the path/file that caused >the operation to fail in the error message payload. Previously, the >FTP implementation only included the error detail and message, making >it harder to debug which file or directory caused the problem. > >Changes: >- Updated _abort_operation($operation) to _abort_operation($operation, $path) >- Updated change_directory() call to pass $remote_directory to _abort_operation >- Added path to error payload, using either the passed path or pwd() as fallback > >This standardization ensures consistent error reporting across all >transport implementations and makes debugging transport issues easier. > >Test plan: >1. Verify FTP transport operations still work correctly >2. Check that error messages now include the path that failed >3. Confirm no regressions in existing FTP functionality > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > Koha/File/Transport/FTP.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/Koha/File/Transport/FTP.pm b/Koha/File/Transport/FTP.pm >index fd484a6623f..4c14744619b 100644 >--- a/Koha/File/Transport/FTP.pm >+++ b/Koha/File/Transport/FTP.pm >@@ -166,7 +166,7 @@ sub _change_directory { > my ( $self, $remote_directory ) = @_; > my $operation = "change_directory"; > >- $self->{connection}->cwd($remote_directory) or return $self->_abort_operation($operation); >+ $self->{connection}->cwd($remote_directory) or return $self->_abort_operation( $operation, $remote_directory ); > > $self->add_message( > { >@@ -289,7 +289,7 @@ sub _is_connected { > } > > sub _abort_operation { >- my ( $self, $operation ) = @_; >+ my ( $self, $operation, $path ) = @_; > > $self->add_message( > { >@@ -297,7 +297,8 @@ sub _abort_operation { > type => 'error', > payload => { > detail => $self->{connection} ? $self->{connection}->status : '', >- error => $self->{connection} ? $self->{connection}->message : $@ >+ error => $self->{connection} ? $self->{connection}->message : $@, >+ path => $path ? $path : $self->{connection}->pwd, > } > } > ); >-- >2.51.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41020
:
187931
|
187932
|
187933
|
187934
|
187935
|
187936
|
187937
|
187938
|
187939
|
187940
|
187941
|
187942
|
188012
|
188013
|
188014
|
188015
|
188016
|
188017
|
188018
|
188030
|
188031
|
188032
|
188033
|
188034
|
188146
|
188147
|
188148
|
188149
|
188150
|
188153
| 188154 |
188155
|
188156
|
188157