Skip to content

Commit 46c533e

Browse files
committed
Refactor login error handling to use map_err for clarity
1 parent 205edf1 commit 46c533e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

crates/smbcloud-network/src/network.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ pub async fn request_login(builder: RequestBuilder) -> Result<AccountStatus, Err
206206
message: error_code.to_string(),
207207
})
208208
}
209-
(status, _) => parse_error_response(response).await.or_else(|_| {
210-
Err(ErrorResponse::Error {
209+
(status, _) => parse_error_response(response)
210+
.await
211+
.map_err(|_| ErrorResponse::Error {
211212
error_code: ErrorCode::NetworkError,
212213
message: format!("Unexpected login response status: {}", status),
213-
})
214-
}),
214+
}),
215215
}
216216
}
217217

0 commit comments

Comments
 (0)