Skip to content

Commit

Permalink
email_routing_desintation: return err, not ErrMissingAccountID
Browse files Browse the repository at this point in the history
Updates the error returned to be the correct API error, not the
incorrect static one.
  • Loading branch information
jacobbednarz committed May 31, 2023
1 parent 3576bf3 commit 19c9053
Showing 1 changed file with 3 additions and 4 deletions.
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 19c9053

Please sign in to comment.