Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit 532fcec

Browse files
committed
Revert "fix: simply cast of unknown err type"
This reverts commit 9c128a6.
1 parent 9c128a6 commit 532fcec

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/lib/api_app/src/api/responses.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::str::FromStr;
2-
31
use super::utils::get_default_headers;
42
use http::header::HeaderMap;
53
use http::StatusCode;
@@ -203,10 +201,10 @@ pub fn resolve_external_service_bad_response(
203201
if response_json.is_object() {
204202
let status = response_json
205203
.get("status")
206-
.and_then(|v| v.as_str())
207-
.unwrap_or("");
208-
if status != "" {
209-
status_code = StatusCode::from_str(status).unwrap_or(status_code);
204+
.and_then(|v| v.as_i64())
205+
.unwrap_or(0);
206+
if status != 0 {
207+
status_code = StatusCode::from_u16(status as u16).unwrap_or(status_code);
210208
}
211209
}
212210

0 commit comments

Comments
 (0)