Skip to content

Commit

Permalink
feat:Feature Exception for remote depoist and payments
Browse files Browse the repository at this point in the history
  • Loading branch information
sathish Ramesh committed Oct 27, 2024
1 parent 5408ec0 commit da4a290
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
* <p>
* Usage:
* <p>
* To create a new feature-specific exception, extend this class and implement
* the {@code getFeatureName} method to return the corresponding feature name.
* Use the constructor to set the user message and error descriptor.
* To create a new feature-specific exception, extend this class and use the
* constructor to set the user message, feature, and error descriptor.
*/
public abstract class FeatureException extends PathRequestException {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.mx.path.model.mdx.accessor.payment;

import com.mx.path.core.common.request.Feature;
import com.mx.path.model.mdx.accessor.feature.ErrorDescriptor;
import com.mx.path.model.mdx.accessor.feature.FeatureException;

/**
* Exception thrown when there is an error related to payment.
* <p>
* This exception is used for payment-related errors, allowing for specific
* error descriptors to be specified.
* </p>
*/
public class PaymentException extends FeatureException {

/**
* Constructs a PaymentException with a specific user message and error descriptor.
*
* @param userMessage The message to be displayed to the user.
* @param errorDescriptor The error descriptor for this exception.
*/
public PaymentException(String userMessage, ErrorDescriptor errorDescriptor) {
super(userMessage, Feature.PAYMENTS, errorDescriptor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.mx.path.model.mdx.accessor.remote_deposit;

import com.mx.path.core.common.request.Feature;
import com.mx.path.model.mdx.accessor.feature.ErrorDescriptor;
import com.mx.path.model.mdx.accessor.feature.FeatureException;

/**
* Exception thrown when there is an error related to remote deposit.
* <p>
* This exception is used for remote deposit-related errors, allowing for specific
* error descriptors to be specified.
* </p>
*/
public class RemoteDepositException extends FeatureException {

/**
* Constructs a RemoteDepositException with a specific user message and error descriptor.
*
* @param userMessage The message to be displayed to the user.
* @param errorDescriptor The error descriptor for this exception.
*/
public RemoteDepositException(String userMessage, ErrorDescriptor errorDescriptor) {
super(userMessage, Feature.REMOTE_DEPOSITS, errorDescriptor);
}
}

0 comments on commit da4a290

Please sign in to comment.