         message (.getMessage err)]
     (case state
       "P0002"
-      (-> (ufc/rsp {:message message
+      (-> (ufc/rsp {:type :error
+                    :message message
                     :code "errors.api.occ"})
           (http/bad-request))
 

(defmethod handler clojure.lang.ExceptionInfo
  [context err]
  (let [message (.getMessage err)
        data (ex-data err)]
    (-> (ufc/rsp {:message message
                  :payload data})
        (http/bad-request))))

(defmethod handler org.jooq.exception.DataAccessException

  [context err]
  (println "????" (class err))
  (let [message (.getMessage err)]
    (-> (ufc/rsp {:type :error
                  :message message
                  :code "errors.api.unexpected"})
        (http/internal-server-error))))
