mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 12:40:12 +00:00
🐛 Fix catch validation errors on exception
This commit is contained in:
parent
b8f940aaab
commit
c54673bf37
@ -541,7 +541,7 @@
|
|||||||
|
|
||||||
(mf/with-effect [report type cause]
|
(mf/with-effect [report type cause]
|
||||||
(when (and (ex/exception? cause)
|
(when (and (ex/exception? cause)
|
||||||
(not (contains? #{:not-found :authentication} type)))
|
(not (contains? #{:not-found :authentication :validation} type)))
|
||||||
(errors/submit-report :event-name "exception-page"
|
(errors/submit-report :event-name "exception-page"
|
||||||
:report report
|
:report report
|
||||||
:hint (ex/get-hint cause))))
|
:hint (ex/get-hint cause))))
|
||||||
@ -553,6 +553,14 @@
|
|||||||
:authentication
|
:authentication
|
||||||
[:> not-found* {}]
|
[:> not-found* {}]
|
||||||
|
|
||||||
|
;; A malformed/invalid resource identifier (e.g. a broken file-id
|
||||||
|
;; in the URL) surfaces as a generic :validation error rather than
|
||||||
|
;; :not-found. By the time it reaches here it has no more specific
|
||||||
|
;; handling (see `handle-error :validation`'s fallback in errors.cljs),
|
||||||
|
;; so treat it the same as "this page doesn't exist".
|
||||||
|
:validation
|
||||||
|
[:> not-found* {}]
|
||||||
|
|
||||||
:bad-gateway
|
:bad-gateway
|
||||||
[:> bad-gateway* props]
|
[:> bad-gateway* props]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user