We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fb53cc commit ecfee0eCopy full SHA for ecfee0e
v1/providers/nebius/errors.go
@@ -1,9 +1,11 @@
1
package v1
2
3
import (
4
+ "errors"
5
"fmt"
6
7
v1 "github.com/brevdev/cloud/v1"
8
+ "github.com/nebius/gosdk/operations"
9
"google.golang.org/grpc/codes"
10
"google.golang.org/grpc/status"
11
)
@@ -35,7 +37,13 @@ func handleErrToCloudErr(e error) error {
35
37
if e == nil {
36
38
return nil
39
}
-
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
47
// Check for gRPC ResourceExhausted status code
48
if grpcStatus, ok := status.FromError(e); ok {
49
if grpcStatus.Code() == codes.ResourceExhausted {
0 commit comments