mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 21:06:13 +02:00
📎 Add service result wrapper
Allows attach metadata to values that does not implement the IObj clojure interface.
This commit is contained in:
parent
47363d96f1
commit
2753a934aa
3 changed files with 23 additions and 5 deletions
|
@ -23,6 +23,7 @@
|
|||
[app.rpc.mutations.projects :as projects]
|
||||
[app.rpc.mutations.teams :as teams]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.services :as sv]
|
||||
[app.util.time :as dt]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
|
@ -278,8 +279,10 @@
|
|||
(defmacro try-on!
|
||||
[expr]
|
||||
`(try
|
||||
{:error nil
|
||||
:result (deref ~expr)}
|
||||
(let [result# (deref ~expr)
|
||||
result# (cond-> result# (sv/wrapped? result#) deref)]
|
||||
{:error nil
|
||||
:result result#})
|
||||
(catch Exception e#
|
||||
{:error (handle-error e#)
|
||||
:result nil})))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue