We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17191a2 commit 83af976Copy full SHA for 83af976
internal/util/hcloudutil/error_framework.go
@@ -68,3 +68,12 @@ func APIErrorDiagnostics(err error) diag.Diagnostics {
68
)
69
return diagnostics
70
}
71
+
72
+// APIErrorIsNotFound check whether the error is an API request Not Found error.
73
+func APIErrorIsNotFound(err error) bool {
74
+ var hcloudErr hcloud.Error
75
+ if errors.As(err, &hcloudErr) {
76
+ return hcloud.IsError(hcloudErr, hcloud.ErrorCodeNotFound)
77
+ }
78
+ return false
79
+}
0 commit comments