-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Problem
Native side log.error() calls in the FTP module are disabled/not visible to users, causing the FTP listener to silently fail in various error scenarios. Errors were being logged but users had no way to see them.
Solution
Replace log.error() calls in catch blocks with creating a BError and calling printStackTrace() which outputs Ballerina-formatted errors that are visible to users.
Files affected
FtpListener.java- 4 locationsFtpContentCallbackHandler.java- 7 locationsFormatMethodsHolder.java- Add upfront regex pattern validation during listener initialization
Changes Required
-
Error Printing: In catch blocks that were using
log.error(message, exception), change to:FtpUtil.createError(message, exception, FtpConstants.FTP_ERROR).printStackTrace();
-
BError Results: When a method returns a
BError, call((BError) result).printStackTrace()instead oflog.error() -
Pattern Validation: Validate
@ftp:FunctionConfig.fileNamePatternregex patterns duringFormatMethodsHolderinitialization rather than catching errors at runtime
Reactions are currently unavailable