Skip to content

Commit

Permalink
Simplify the error check method
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Memisoglu committed Aug 13, 2019
1 parent 138f344 commit fd08822
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/blockstorage/awsefs/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import (
)

func isVolumeNotFound(err error) bool {
switch errV := err.(type) {
switch errV := errors.Cause(err).(type) {
case awserr.Error:
return errV.Code() == awsefs.ErrCodeFileSystemNotFound
case errors.Causer:
return isVolumeNotFound(errV.Cause())
default:
return false
}
Expand Down

0 comments on commit fd08822

Please sign in to comment.