Skip to content

Commit 0d2bb0e

Browse files
committed
implement review feedback
1 parent 5ed3181 commit 0d2bb0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/iaasalpha/wait/wait.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package wait
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net/http"
78
"time"
@@ -28,7 +29,7 @@ func CreateNetworkWaitHandler(ctx context.Context, a APIClientInterface, project
2829
return false, network, err
2930
}
3031
if network.Id == nil || network.Status == nil {
31-
return false, network, fmt.Errorf("crate failed for network with id %s, the response is not valid: the id or the state are missing", networkId)
32+
return false, network, fmt.Errorf("create failed for network with id %s, the response is not valid: the id or the state are missing", networkId)
3233
}
3334
// The state returns to "CREATED" after a successful creation is completed
3435
if *network.Id == networkId && *network.Status == CreateSuccess {
@@ -69,7 +70,8 @@ func DeleteNetworkWaitHandler(ctx context.Context, a APIClientInterface, project
6970
if err == nil {
7071
return false, nil, nil
7172
}
72-
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
73+
var oapiErr *oapierror.GenericOpenAPIError
74+
ok := errors.As(err, &oapiErr)
7375
if !ok {
7476
return false, network, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError: %w", err)
7577
}

0 commit comments

Comments
 (0)