boraarslan / mapper-influence

0 stars 0 forks source link

Implementing new trait for osu! API to return response body on errors #78

Closed 112batuhan closed 1 year ago

112batuhan commented 1 year ago

Implemented a new trait for request response struct.

Also implemented a new error struct. This error struct contains a struct variant with the status code and the body in String form if the error is caused by API request. This status code can be matched with the constants defined in the documentation.

assert_eq!(
    err.status(),
    Some(reqwest::StatusCode::BAD_REQUEST)
);
112batuhan commented 1 year ago

The error handling is not ready yet. I will work on the error conversion in AppError

112batuhan commented 1 year ago

Completed @boraarslan