aboutsummaryrefslogtreecommitdiff
path: root/src/components/ErrorBoundary.tsx
diff options
context:
space:
mode:
authormegumin <megumin.bakaretsurie@gmail.com>2022-10-17 20:18:25 +0100
committerGitHub <noreply@github.com>2022-10-17 20:18:25 +0100
commit5625d63e46c43132676148a86739025c15fa5f2d (patch)
tree3699e126ad86cc2972b3aecfe4eeaef378e9e9f4 /src/components/ErrorBoundary.tsx
parentae730e83984cbf4dc804eebbf260a055bfe635c0 (diff)
downloadVencord-5625d63e46c43132676148a86739025c15fa5f2d.tar.gz
Vencord-5625d63e46c43132676148a86739025c15fa5f2d.tar.bz2
Vencord-5625d63e46c43132676148a86739025c15fa5f2d.zip
Settings 2.0 (#107)
Co-authored-by: Vendicated <vendicated@riseup.net>
Diffstat (limited to 'src/components/ErrorBoundary.tsx')
-rw-r--r--src/components/ErrorBoundary.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx
index c62acb0..bb0c336 100644
--- a/src/components/ErrorBoundary.tsx
+++ b/src/components/ErrorBoundary.tsx
@@ -5,6 +5,7 @@ import { ErrorCard } from "./ErrorCard";
interface Props {
fallback?: React.ComponentType<React.PropsWithChildren<{ error: any; message: string; stack: string; }>>;
onError?(error: Error, errorInfo: React.ErrorInfo): void;
+ message?: string;
}
const color = "#e78284";
@@ -58,15 +59,14 @@ export default class ErrorBoundary extends React.Component<React.PropsWithChildr
{...this.state}
/>;
+ const msg = this.props.message || "An error occurred while rendering this Component. More info can be found below and in your console.";
+
return (
<ErrorCard style={{
overflow: "hidden",
}}>
<h1>Oh no!</h1>
- <p>
- An error occurred while rendering this Component. More info can be found below
- and in your console.
- </p>
+ <p>{msg}</p>
<code>
{this.state.message}
{!!this.state.stack && (