fix: auto retry once for connection closed (#3426)

Co-authored-by: venkatesh.devendran <venkatesh.devendran@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Venkatesh
2024-02-06 14:45:01 +05:30
committed by GitHub
parent 3705f77ee4
commit 94e9b26854
3 changed files with 84 additions and 24 deletions

View File

@ -267,7 +267,7 @@ pub enum ApiClientError {
RequestTimeoutReceived,
#[error("connection closed before a message could complete")]
ConnectionClosed,
ConnectionClosedIncompleteMessage,
#[error("Server responded with Internal Server Error")]
InternalServerErrorReceived,
@ -285,8 +285,8 @@ impl ApiClientError {
pub fn is_upstream_timeout(&self) -> bool {
self == &Self::RequestTimeoutReceived
}
pub fn is_connection_closed(&self) -> bool {
self == &Self::ConnectionClosed
pub fn is_connection_closed_before_message_could_complete(&self) -> bool {
self == &Self::ConnectionClosedIncompleteMessage
}
}