mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
Merge pull request #4943 from penpot/niwinz-temporal-log
✨ Add temporal log entry for profile insert conflict
This commit is contained in:
commit
e72e812166
1 changed files with 10 additions and 7 deletions
|
@ -286,14 +286,17 @@
|
||||||
(try
|
(try
|
||||||
(-> (db/insert! conn :profile params)
|
(-> (db/insert! conn :profile params)
|
||||||
(profile/decode-row))
|
(profile/decode-row))
|
||||||
(catch org.postgresql.util.PSQLException e
|
(catch org.postgresql.util.PSQLException cause
|
||||||
(let [state (.getSQLState e)]
|
(let [state (.getSQLState cause)]
|
||||||
(if (not= state "23505")
|
(if (not= state "23505")
|
||||||
(throw e)
|
(throw cause)
|
||||||
(ex/raise :type :validation
|
|
||||||
:code :email-already-exists
|
(do
|
||||||
:hint "email already exists"
|
(l/error :hint "not an error" :cause cause)
|
||||||
:cause e)))))))
|
(ex/raise :type :validation
|
||||||
|
:code :email-already-exists
|
||||||
|
:hint "email already exists"
|
||||||
|
:cause cause))))))))
|
||||||
|
|
||||||
(defn create-profile-rels!
|
(defn create-profile-rels!
|
||||||
[conn {:keys [id] :as profile}]
|
[conn {:keys [id] :as profile}]
|
||||||
|
|
Loading…
Add table
Reference in a new issue