diff --git a/src/renderer/ErrorBoundary.jsx b/src/renderer/ErrorBoundary.jsx new file mode 100644 index 000000000..a9191cd75 --- /dev/null +++ b/src/renderer/ErrorBoundary.jsx @@ -0,0 +1,29 @@ +/* eslint-disable */ +import React from "react"; + +class ErrorBoundary extends React.Component { + constructor(props) { + super(props); + this.state = { hasError: true, errorMessage: "" }; + } + + static getDerivedStateFromError(error) { + return { hasError: true, errorMessage: error.message }; + } + + render() { + if (this.state.hasError) { + return ( +
This wasn't supposed to happen. If you continue to see this message, please reach out to support.
+{this.state.errorMessage}
+