We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 09459f7 + 214c0d7 commit d4ba874Copy full SHA for d4ba874
cloud/errors.go
@@ -17,13 +17,13 @@ limitations under the License.
17
package azure
18
19
import (
20
+ "errors"
21
+
22
"github.com/Azure/go-autorest/autorest"
23
)
24
25
// ResourceNotFound parses the error to check if it's a resource not found
26
func ResourceNotFound(err error) bool {
- if derr, ok := err.(autorest.DetailedError); ok && derr.StatusCode == 404 {
- return true
27
- }
28
- return false
+ derr := autorest.DetailedError{}
+ return errors.As(err, &derr) && derr.StatusCode == 404
29
}
0 commit comments