Skip to content

Commit ecfee0e

Browse files
fix: nebius provisioning error (#108)
1 parent 4fb53cc commit ecfee0e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

v1/providers/nebius/errors.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package v1
22

33
import (
4+
"errors"
45
"fmt"
56

67
v1 "github.com/brevdev/cloud/v1"
8+
"github.com/nebius/gosdk/operations"
79
"google.golang.org/grpc/codes"
810
"google.golang.org/grpc/status"
911
)
@@ -35,7 +37,13 @@ func handleErrToCloudErr(e error) error {
3537
if e == nil {
3638
return nil
3739
}
38-
40+
// Check for Nebius operations.Error for ResourceExhausted (returned by operation.Wait on async failures)
41+
var opErr *operations.Error
42+
if errors.As(e, &opErr) {
43+
if opErr.Code == codes.ResourceExhausted {
44+
return v1.ErrOutOfQuota
45+
}
46+
}
3947
// Check for gRPC ResourceExhausted status code
4048
if grpcStatus, ok := status.FromError(e); ok {
4149
if grpcStatus.Code() == codes.ResourceExhausted {

0 commit comments

Comments
 (0)