You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tthe ErrorResponse type copies the http.Response unnecessarily since all packngo API methods return both an error and the http.Response.
A more fitting error type would be one that simplifies the single and multiple errors returned from the Equinix Metal API. This could be done with a packngo.Error type (effectively ErrorResponse, without embedding *http.Response)
One missed advantage of the ErrorResponse type is that http.Response was embedded instead of packngo.Response (which offers insight into Equinix Metal API rate-limits).
In retrospect, I think it may have been a better pattern to return (for example) Devices.List() ([]Device, *packngo.Response, error) (with the error being an packngo.Error in most cases).
The text was updated successfully, but these errors were encountered:
In Terraform, an ErrorResponse type was created mimicking the packngo.ErrorResponse type. This has created difficulty in handling errors (as expressed in the comments listed above).
Tthe ErrorResponse type copies the http.Response unnecessarily since all packngo API methods return both an error and the http.Response.
A more fitting error type would be one that simplifies the single and multiple errors returned from the Equinix Metal API. This could be done with a packngo.Error type (effectively ErrorResponse, without embedding *http.Response)
One missed advantage of the ErrorResponse type is that
http.Response
was embedded instead ofpackngo.Response
(which offers insight into Equinix Metal API rate-limits).In retrospect, I think it may have been a better pattern to return (for example)
Devices.List() ([]Device, *packngo.Response, error)
(with the error being an packngo.Error in most cases).The text was updated successfully, but these errors were encountered: