               (ring.response/content-type "text/html")
               (ring.response/status 500)))))))
 
+(s/def ::error-response string?)
+
+(defmethod integrant-key :akvo.lumen.component.handler/wrap-hide-errors [_]
+  (s/cat :kw keyword?
+         :config (s/keys :req-un [::error-response])))
+
 (defmethod ig/init-key :akvo.lumen.component.handler/wrap-not-found  [_ {:keys [error-response]}]
   (fn [handler]
     (fn [request]

(defmethod ig/init-key :akvo.lumen.component.handler/wrap-json-body  [_ opts]
  ring.middleware.json/wrap-json-body)

(defmethod ig/init-key :akvo.lumen.component.handler/wrap-json-response  [_ opts]
  ring.middleware.json/wrap-json-response)

(defmethod ig/init-key :akvo.lumen.component.handler/wrap-defaults  [_ opts]
  #(ring.middleware.defaults/wrap-defaults % opts))

(defmethod ig/init-key :akvo.lumen.component.handler/wrap-hide-errors  [_ {:keys [error-response]}]
  (fn [handler]

          (-> (compojure.res/render error-response request)
              (ring.response/content-type "text/html")
              (ring.response/status 404))))))

(defmethod integrant-key :akvo.lumen.component.handler/wrap-not-found [_]
  (s/cat :kw keyword?
         :config (s/keys :req-un [::error-response])))
