Closed ctreatma closed 3 months ago
Converting to draft because there is some convoluted usage of state waiters for deletions that only works if the waiter returns an error object that includes the HTTP response, and this change doesn't help with that problem.
Closing; I think ultimately the ErrorResponse type and the FriendlyError
methods should go away, since they don't seem to add much, but that's a bigger question and the existing code seems to be working well enough for now.
The
equinix_errors.IgnoreHttpResponseErrors
function was introduced to support migration of Metal resources frompackngo
toequinix-sdk-go
. However, the check functions that were passed in to it (such asequinix_errors.IsNotFound
) only work correctly for errors fromequinix-sdk-go
if the error is first converted to anErrorResponse
by callingequinix_errors.FriendlyErrorForMetalGo(resp, err)
.This updates
equinix_errors.IgnoreHttpResponseErrors
to only check the response status code.