mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-08 08:09:05 +08:00
feat(router): send connector timeouts and connection closures as 2xx response instead of giving 5xx response (#2047)
This commit is contained in:
committed by
GitHub
parent
c9fe389b2c
commit
31088b6062
@ -273,6 +273,9 @@ pub enum ApiClientError {
|
||||
#[error("Server responded with Request Timeout")]
|
||||
RequestTimeoutReceived,
|
||||
|
||||
#[error("connection closed before a message could complete")]
|
||||
ConnectionClosed,
|
||||
|
||||
#[error("Server responded with Internal Server Error")]
|
||||
InternalServerErrorReceived,
|
||||
#[error("Server responded with Bad Gateway")]
|
||||
@ -566,6 +569,9 @@ impl ApiClientError {
|
||||
pub fn is_upstream_timeout(&self) -> bool {
|
||||
self == &Self::RequestTimeoutReceived
|
||||
}
|
||||
pub fn is_connection_closed(&self) -> bool {
|
||||
self == &Self::ConnectionClosed
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorError {
|
||||
|
||||
Reference in New Issue
Block a user