mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
fix: proper error message for payment cancel (#192)
This commit is contained in:
committed by
GitHub
parent
47741b47fa
commit
55d161b826
@ -281,6 +281,8 @@ pub enum ConnectorError {
|
||||
FailedToObtainIntegrationUrl,
|
||||
#[error("Failed to encode connector request")]
|
||||
RequestEncodingFailed,
|
||||
#[error("Request encoding failed : {0}")]
|
||||
RequestEncodingFailedWithReason(String),
|
||||
#[error("Failed to deserialize connector response")]
|
||||
ResponseDeserializationFailed,
|
||||
#[error("Failed to execute a processing step: {0:?}")]
|
||||
|
||||
@ -102,6 +102,9 @@ impl ConnectorErrorExt for error_stack::Report<errors::ConnectorError> {
|
||||
}
|
||||
}
|
||||
}
|
||||
errors::ConnectorError::RequestEncodingFailedWithReason(reason) => {
|
||||
Some(serde_json::json!(reason))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
self.change_context(errors::ApiErrorResponse::PaymentAuthorizationFailed { data })
|
||||
|
||||
Reference in New Issue
Block a user