diff --git a/error.go b/error.go index 9d06194..ad60cc6 100644 --- a/error.go +++ b/error.go @@ -47,3 +47,17 @@ func checkResponse(r *http.Response) error { } return errorResponse } + +func IsNoSuchKeyError(e error) bool { + if e == nil { + return false + } + err, ok := e.(*ErrorResponse) + if !ok { + return false + } + if err.Response != nil && err.Response.StatusCode == 404 && err.Code == "NoSuchKey" { + return true + } + return false +}