diff --git a/src/uxbox/main/repo.cljs b/src/uxbox/main/repo.cljs index 920aedb61..f098d7309 100644 --- a/src/uxbox/main/repo.cljs +++ b/src/uxbox/main/repo.cljs @@ -6,7 +6,7 @@ (ns uxbox.main.repo "A main interface for access to remote resources." - (:require [httpurr.status :as status] + (:require [uxbox.util.http :as http] [uxbox.main.repo.auth] [uxbox.main.repo.users] [uxbox.main.repo.projects] @@ -23,5 +23,5 @@ ([type data] (impl/request type data))) -(def client-error? status/client-error?) -(def server-error? status/server-error?) +(def client-error? http/client-error?) +(def server-error? http/server-error?) diff --git a/src/uxbox/util/http.cljs b/src/uxbox/util/http.cljs index f0e9f2208..28e5d6659 100644 --- a/src/uxbox/util/http.cljs +++ b/src/uxbox/util/http.cljs @@ -93,6 +93,14 @@ [{:keys [status]}] (<= 200 status 299)) +(defn server-error? + [{:keys [status]}] + (<= 500 status 599)) + +(defn client-error? + [{:keys [status]}] + (<= 400 status 499)) + (defn send! ([request] (send! request nil))