From 93d4dc8cb5fc0fb3f6b1c24fd4a11be905de5fc8 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 24 Jan 2022 16:55:47 +0200 Subject: [PATCH] [#13038] Add error message to email template on crash --- src/status_im/utils/error_handler.cljs | 2 +- src/status_im/utils/logging/core.cljs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/status_im/utils/error_handler.cljs b/src/status_im/utils/error_handler.cljs index a717a2d92f..a80dd10d60 100644 --- a/src/status_im/utils/error_handler.cljs +++ b/src/status_im/utils/error_handler.cljs @@ -60,4 +60,4 @@ {:title "Error" :content (.-message e) :confirm-button-text (i18n/label :t/send-logs) - :on-accept #(re-frame/dispatch [:logging.ui/send-logs-pressed :email])}))))))) + :on-accept #(re-frame/dispatch [:logging/send-logs-on-error (.-message e)])}))))))) diff --git a/src/status_im/utils/logging/core.cljs b/src/status_im/utils/logging/core.cljs index dba53889cc..69ea87efcd 100644 --- a/src/status_im/utils/logging/core.cljs +++ b/src/status_im/utils/logging/core.cljs @@ -153,6 +153,13 @@ ::share-logs-file)]}) (send-email-event cofx nil))) +(fx/defn send-logs-on-error + {:events [:logging/send-logs-on-error]} + [{:keys [db]} error-message] + (fx/merge + {:db (assoc-in db [:bug-report/details :description] error-message)} + (send-logs :email))) + (fx/defn show-client-error {:events [:show-client-error]} [_]