mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Fix unexpected exception on time equiv impl.
This commit is contained in:
parent
2aeded1940
commit
1d174a4379
3 changed files with 13 additions and 16 deletions
|
@ -217,11 +217,7 @@
|
|||
(ex/raise :type :assertion
|
||||
:code :spec-validation
|
||||
:hint hint
|
||||
::ex/data ctx
|
||||
::s/value val
|
||||
::s/problems (::s/problems data)))))
|
||||
|
||||
|
||||
::ex/data (merge ctx data)))))
|
||||
|
||||
(defmacro assert
|
||||
"Development only assertion macro."
|
||||
|
|
|
@ -106,14 +106,14 @@
|
|||
;; assertion (assertion that is preserved on production builds). From
|
||||
;; the user perspective this should be treated as internal error.
|
||||
(defmethod ptk/handle-error :assertion
|
||||
[{:keys [data stack message hint context] :as error}]
|
||||
[{:keys [message hint] :as error}]
|
||||
(let [message (or message hint)
|
||||
message (str "Internal Assertion Error: " message)
|
||||
context (str/fmt "ns: '%s'\nname: '%s'\nfile: '%s:%s'"
|
||||
(:ns context)
|
||||
(:name context)
|
||||
(str cf/public-uri "js/cljs-runtime/" (:file context))
|
||||
(:line context))]
|
||||
(:ns error)
|
||||
(:name error)
|
||||
(str cf/public-uri "js/cljs-runtime/" (:file error))
|
||||
(:line error))]
|
||||
(ts/schedule
|
||||
(st/emitf
|
||||
(dm/show {:content "Internal error: assertion."
|
||||
|
@ -123,10 +123,7 @@
|
|||
;; Print to the console some debugging info
|
||||
(js/console.group message)
|
||||
(js/console.info context)
|
||||
(js/console.groupCollapsed "Stack Trace")
|
||||
(js/console.info stack)
|
||||
(js/console.groupEnd "Stack Trace")
|
||||
(js/console.error (with-out-str (expound/printer data)))
|
||||
(js/console.error (with-out-str (expound/printer error)))
|
||||
(js/console.groupEnd message)))
|
||||
|
||||
;; This happens when the backed server fails to process the
|
||||
|
|
|
@ -106,11 +106,15 @@
|
|||
(extend-protocol IEquiv
|
||||
DateTime
|
||||
(-equiv [it other]
|
||||
(.equals it other))
|
||||
(if other
|
||||
(.equals it other)
|
||||
false))
|
||||
|
||||
Duration
|
||||
(-equiv [it other]
|
||||
(.equals it other)))
|
||||
(if other
|
||||
(.equals it other)
|
||||
false)))
|
||||
|
||||
(extend-protocol Inst
|
||||
DateTime
|
||||
|
|
Loading…
Reference in a new issue