Bugzilla – Attachment 188147 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 09:33:23 UTC
(
hide
)
Description:
Bug 41020: Standardize _abort_operation() signature in FTP transport
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-20 09:33:23 UTC
Size:
2.59 KB
patch
obsolete
>From 6cebc10ef46dc63db408a896cae06639d67ef00f 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 cce88f5b3a7..47672ea7398 100644 >--- a/Koha/File/Transport/FTP.pm >+++ b/Koha/File/Transport/FTP.pm >@@ -165,7 +165,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( > { >@@ -288,7 +288,7 @@ sub _is_connected { > } > > sub _abort_operation { >- my ( $self, $operation ) = @_; >+ my ( $self, $operation, $path ) = @_; > > $self->add_message( > { >@@ -296,7 +296,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