Skip to content

Commit

Permalink
Small change as per PR
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Sep 15, 2023
1 parent 5e5c7ea commit d58efd2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apierr/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ func GetErrorInfo(err error) []ErrorDetail {

func getDetailsByType(err error, errorDetailType string) []ErrorDetail {
var apiError *APIError
if errors.As(err, &apiError) {
filteredDetails := []ErrorDetail{}
for _, detail := range apiError.Details {
if errrorDetailsType == detail.Type {
filteredDetails = append(filteredDetails, detail)
}
if !errors.As(err, &apiError) {
return nil
}
filteredDetails := []ErrorDetail{}
for _, detail := range apiError.Details {
if errorDetailType == detail.Type {
filteredDetails = append(filteredDetails, detail)
}
return filteredDetails
}
return nil
return filteredDetails
}

// IsMissing tells if it is missing resource
Expand Down

0 comments on commit d58efd2

Please sign in to comment.