Skip to content

Commit

Permalink
feat: add error handling to check DatabaseVolumeSnapshotLimitExceeded…
Browse files Browse the repository at this point in the history
…Error

Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Dec 9, 2024
1 parent 46b751a commit 5edc26d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/driver/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
// VolID: req.SourceVolumeId,
// })
// if err != nil {
// if strings.Contains(err.Error(), "DatabaseVolumeSnapshotLimitExceededError") {
// log.Error().Err(err).Msg("Requested volume snapshot would exceed volume quota available")
// return nil, status.Errorf(codes.ResourceExhausted, "failed to create volume snapshot due to over quota: %s", err)
// }
// log.Error().Err(err).Msg("Unable to create snapshot in Civo API")
// return nil, status.Errorf(codes.Internal, "failed to create volume snapshot: %s", err)
// }
Expand Down

0 comments on commit 5edc26d

Please sign in to comment.