Skip to content

Commit

Permalink
Merge pull request #1297 from jacobbednarz/return-actual-err
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed May 31, 2023
2 parents 3576bf3 + aebf178 commit 126ef3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/1297.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
email_routing_destination: return encountered error, not `ErrMissingAccountID` all the time
```
7 changes: 3 additions & 4 deletions email_routing_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ func (api *API) CreateEmailRoutingDestinationAddress(ctx context.Context, rc *Re
}

uri := fmt.Sprintf("/accounts/%s/email/routing/addresses", rc.Identifier)

res, err := api.makeRequestContext(ctx, http.MethodPost, uri, params)
if err != nil {
return EmailRoutingDestinationAddress{}, ErrMissingAccountID
return EmailRoutingDestinationAddress{}, err
}

var r CreateEmailRoutingAddressResponse
Expand All @@ -119,7 +118,7 @@ func (api *API) GetEmailRoutingDestinationAddress(ctx context.Context, rc *Resou

res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
if err != nil {
return EmailRoutingDestinationAddress{}, ErrMissingAccountID
return EmailRoutingDestinationAddress{}, err
}

var r CreateEmailRoutingAddressResponse
Expand All @@ -143,7 +142,7 @@ func (api *API) DeleteEmailRoutingDestinationAddress(ctx context.Context, rc *Re

res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil)
if err != nil {
return EmailRoutingDestinationAddress{}, ErrMissingAccountID
return EmailRoutingDestinationAddress{}, err
}

var r CreateEmailRoutingAddressResponse
Expand Down

0 comments on commit 126ef3e

Please sign in to comment.