ui: capture invalid pdf error

pull/5072/head
Junyi Du 2022-04-22 15:00:18 +08:00 committed by Tienson Qin
parent 3973f2794e
commit 6746c8813e
2 changed files with 16 additions and 3 deletions

View File

@ -1078,9 +1078,19 @@
"MissingPDFException"
(do
(notification/show!
(str (.-message error) " Is this the correct path?")
:error
false)
(str (.-message error) " Is this the correct path?")
:error
false)
(state/set-state! :pdf/current nil))
"InvalidPDFException"
(do
(notification/show!
(str (.-message error) "\n"
"Is this .pdf file corrupted?\n"
"Please confirm with external pdf viewer.")
:error
false)
(state/set-state! :pdf/current nil)))))
[(:error state)])

View File

@ -715,6 +715,9 @@
< {:did-catch
(fn [state error _info]
(log/error :exception error)
(notification-handler/show!
(str "Error caught by UI!\n " error)
:error)
(assoc state ::error error))}
[{error ::error, c :rum/react-component} error-view view]
(if (some? error)