mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(api_event_errors): error field in APIEvents (#2808)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: harsh-sharma-juspay <125131007+harsh-sharma-juspay@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use reqwest::StatusCode;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub enum ErrorType {
|
||||
@ -78,7 +79,8 @@ pub struct Extra {
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Serialize, Debug, Clone)]
|
||||
#[serde(tag = "type", content = "value")]
|
||||
pub enum ApiErrorResponse {
|
||||
Unauthorized(ApiError),
|
||||
ForbiddenCommonResource(ApiError),
|
||||
@ -88,7 +90,7 @@ pub enum ApiErrorResponse {
|
||||
Unprocessable(ApiError),
|
||||
InternalServerError(ApiError),
|
||||
NotImplemented(ApiError),
|
||||
ConnectorError(ApiError, StatusCode),
|
||||
ConnectorError(ApiError, #[serde(skip_serializing)] StatusCode),
|
||||
NotFound(ApiError),
|
||||
MethodNotAllowed(ApiError),
|
||||
BadRequest(ApiError),
|
||||
|
||||
Reference in New Issue
Block a user