diff --git a/error.go b/error.go index 91c8a15620..5ddc9576af 100644 --- a/error.go +++ b/error.go @@ -29,14 +29,6 @@ const ( Missing ErrorCode = "missing" ProcessingErr ErrorCode = "processing_error" RateLimit ErrorCode = "rate_limit" - - // These additional types are written purely for backward compatibility - // (the originals were given quite unsuitable names) and should be - // considered deprecated. Remove them on the next major version revision. - - APIErr ErrorType = ErrorTypeAPI - CardErr ErrorType = ErrorTypeCard - InvalidRequest ErrorType = ErrorTypeInvalidRequest ) // Error is the response returned when a call is unsuccessful. diff --git a/error_test.go b/error_test.go index 693579e4c5..e48ac3cfc4 100644 --- a/error_test.go +++ b/error_test.go @@ -18,7 +18,7 @@ func TestErrorResponse(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Request-Id", "req_123") w.WriteHeader(http.StatusUnauthorized) - fmt.Fprintln(w, `{"error":{"message":"bar","type":"`+InvalidRequest+`"}}`) + fmt.Fprintln(w, `{"error":{"message":"bar","type":"`+ErrorTypeInvalidRequest+`"}}`) })) defer ts.Close() @@ -32,7 +32,7 @@ func TestErrorResponse(t *testing.T) { assert.Error(t, err) stripeErr := err.(*Error) - assert.Equal(t, InvalidRequest, stripeErr.Type) + assert.Equal(t, ErrorTypeInvalidRequest, stripeErr.Type) assert.Equal(t, "req_123", stripeErr.RequestID) assert.Equal(t, 401, stripeErr.HTTPStatusCode) }