mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
Update ErrorBoundary.tsx
This commit is contained in:
parent
e881735a23
commit
42e0f34138
1 changed files with 2 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ const logError = (error: Error, info: ErrorInfo) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ErrorBoundary({ children }: { children: ReactNode }) {
|
export function ErrorBoundary({ children }: { children: ReactNode }) {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages, labels } = useMessages();
|
||||||
|
|
||||||
const fallbackRender = ({ error, resetErrorBoundary }) => {
|
const fallbackRender = ({ error, resetErrorBoundary }) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -18,7 +18,7 @@ export function ErrorBoundary({ children }: { children: ReactNode }) {
|
||||||
<h1>{formatMessage(messages.error)}</h1>
|
<h1>{formatMessage(messages.error)}</h1>
|
||||||
<h3>{error.message}</h3>
|
<h3>{error.message}</h3>
|
||||||
<pre>{error.stack}</pre>
|
<pre>{error.stack}</pre>
|
||||||
<Button onClick={resetErrorBoundary}>OK</Button>
|
<Button onClick={resetErrorBoundary}>{formatMessage(labels.ok)}</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue