mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 20:23:43 +08:00
refactor: update API response for JSON deserialization errors (#6610)
This commit is contained in:
@ -81,7 +81,11 @@ pub mod error_parser {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(
|
||||
serde_json::to_string(&serde_json::json!({
|
||||
"error": self.err.to_string()
|
||||
"error": {
|
||||
"error_type": "invalid_request",
|
||||
"message": self.err.to_string(),
|
||||
"code": "IR_06",
|
||||
}
|
||||
}))
|
||||
.as_deref()
|
||||
.unwrap_or("Invalid Json Error"),
|
||||
|
||||
Reference in New Issue
Block a user