Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/oapierror/oapierror.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oapiError
package oapierror

import (
"fmt"
Expand Down
4 changes: 2 additions & 2 deletions core/wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"time"

oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror"
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
"github.com/stackitcloud/stackit-sdk-go/core/utils"
)

Expand Down Expand Up @@ -96,7 +96,7 @@ func (w *Handler) WaitWithContext(ctx context.Context) (res interface{}, err err
}

func (w *Handler) handleError(retryTempErrorCounter int, err error) (int, error) {
oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
if !ok {
return retryTempErrorCounter, fmt.Errorf("could not convert error to GenericOpenApiError, %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions core/wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror"
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
)

func TestNew(t *testing.T) {
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestHandleError(t *testing.T) {
}{
{
desc: "handle_oapi_error",
reqErr: &oapiError.GenericOpenAPIError{
reqErr: &oapierror.GenericOpenAPIError{
StatusCode: http.StatusInternalServerError,
},
tempErrRetryLimit: 5,
Expand All @@ -209,23 +209,23 @@ func TestHandleError(t *testing.T) {
},
{
desc: "bad_gateway_error",
reqErr: &oapiError.GenericOpenAPIError{
reqErr: &oapierror.GenericOpenAPIError{
StatusCode: http.StatusBadGateway,
},
tempErrRetryLimit: 5,
wantErr: false,
},
{
desc: "gateway_timeout_error",
reqErr: &oapiError.GenericOpenAPIError{
reqErr: &oapierror.GenericOpenAPIError{
StatusCode: http.StatusBadGateway,
},
tempErrRetryLimit: 5,
wantErr: false,
},
{
desc: "temp_error_retry_limit_reached",
reqErr: &oapiError.GenericOpenAPIError{
reqErr: &oapierror.GenericOpenAPIError{
StatusCode: http.StatusBadGateway,
},
tempErrRetryLimit: 1,
Expand Down
Loading