You've already forked email-api-client
refactor: update error handling for HTTP response status codes
All checks were successful
🚀 Publish Release Package / publish (push) Successful in 20s
All checks were successful
🚀 Publish Release Package / publish (push) Successful in 20s
This commit is contained in:
@@ -36,7 +36,7 @@ func (client *Client) SendEmail(request *EmailRequest) (*EmailCreateResponse, er
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode >= http.StatusBadRequest {
|
||||||
response, err := readResponseBody[Response[ErrorResponse]](resp)
|
response, err := readResponseBody[Response[ErrorResponse]](resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user