Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: show error message on crash

ammarahm-ed6bc791d935bb
diff --git a/apps/mobile/app/components/exception-handler/index.tsx b/apps/mobile/app/components/exception-handler/index.tsx
index e3ea610f2..78009dcaa 100644
--- a/apps/mobile/app/components/exception-handler/index.tsx
+++ b/apps/mobile/app/components/exception-handler/index.tsx
@@ -36,16 +36,12 @@ class ExceptionHandler extends React.Component<{
component: string;
}> {
state: {
- error: {
- title: string;
- stack: string;
- } | null;
+ error: Error | null;
hasError: boolean;
} = {
hasError: false,
error: null
};
-
static getDerivedStateFromError(error: Error) {
return { hasError: true, error: error };
}
@@ -72,7 +68,7 @@ class ExceptionHandler extends React.Component<{
this.state.error?.stack || "",
this.props.component
)}
- defaultTitle={this.state.error?.title || "Unknown Error"}
+ defaultTitle={this.state.error?.message}
issueTitle="An exception occured"
/>
<Dialog />