Skip to content

Commit 662e10f

Browse files
committed
Don't throw on s3 not-found
The intention was to treat this as a nil, but we were throwing by mistake.
1 parent b5fbe9e commit 662e10f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/clojars/aws_util.clj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
(:require
33
[cognitect.aws.client.api :as aws]))
44

5+
(defn- not-found-error?
6+
[v]
7+
(= :cognitect.anomalies/not-found (:cognitect.anomalies/category v)))
8+
59
(defn- throw-on-error
610
[v]
7-
(if (some? (:cognitect.anomalies/category v))
11+
(if (and (some? (:cognitect.anomalies/category v))
12+
(not (not-found-error? v)))
813
(throw (ex-info "AWS request failed" v))
914
v))
1015

@@ -14,5 +19,5 @@
1419

1520
(defn not-found->nil
1621
[v]
17-
(when (not= :cognitect.anomalies/not-found (:cognitect.anomalies/category v))
22+
(when (not (not-found-error? v))
1823
v))

0 commit comments

Comments
 (0)