Skip to content

Commit 6a2a6ef

Browse files
committed
fix parsing error
1 parent 08f2d1c commit 6a2a6ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/smbcloud-network/src/network.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub async fn parse_error_response<T: DeserializeOwned>(
7171
println!();
7272
}
7373

74-
let error_response = match serde_json::from_str::<T>(&error_response_body) {
74+
let error_response = match serde_json::from_str(&error_response_body) {
7575
Ok(error_response) => error_response,
7676
Err(e) => {
7777
error!("Failed to parse error response: {:?}", e);
@@ -82,7 +82,8 @@ pub async fn parse_error_response<T: DeserializeOwned>(
8282
}
8383
};
8484
// The parsing itself is succeed.
85-
Ok(error_response)
85+
// Why is this an ErrorResponse.
86+
Err(error_response)
8687
}
8788

8889
pub async fn request_login(builder: RequestBuilder) -> Result<AccountStatus, ErrorResponse> {

0 commit comments

Comments
 (0)