mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 12:26:10 +02:00
Import backend code inside the repository.
This commit is contained in:
parent
e21798f1ed
commit
de57630c14
113 changed files with 8040 additions and 0 deletions
21
backend/src/uxbox/util/exceptions.clj
Normal file
21
backend/src/uxbox/util/exceptions.clj
Normal file
|
@ -0,0 +1,21 @@
|
|||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.exceptions
|
||||
"A helpers for work with exceptions.")
|
||||
|
||||
(defn error
|
||||
[& {:keys [type code message] :or {type :unexpected} :as payload}]
|
||||
{:pre [(keyword? type) (keyword? code)]}
|
||||
(let [message (if message
|
||||
(str message " / " (pr-str code) "")
|
||||
(pr-str code))
|
||||
payload (assoc payload :type type)]
|
||||
(ex-info message payload)))
|
||||
|
||||
(defmacro raise
|
||||
[& args]
|
||||
`(throw (error ~@args)))
|
Loading…
Add table
Add a link
Reference in a new issue