fix(ErrorBoundary): Fixing console errors and Improving error logging for better developer experience (#5378)
This commit is contained in:
1 parent
f6d05bc21c
commit
56c5828b02
2 files changed
+5
-5
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { ErrorBoundary as ReactErrorBoundary, FallbackProps } from 'react-error-boundary';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Dialog, DialogContent } from '../Dialog/Dialog';
|
||||
import { Dialog, DialogContent, DialogTitle } from '../Dialog/Dialog';
|
||||
import { ScrollArea } from '../ScrollArea/ScrollArea';
|
||||
import { Button } from '../Button/Button';
|
||||
import { useNotification } from '../../contextProviders';
|
||||
@@ -181,6 +181,7 @@ const DefaultFallback = ({
|
||||
open={showDetails}
|
||||
onOpenChange={setShowDetails}
|
||||
>
|
||||
<DialogTitle className="invisible">{errorTitle}</DialogTitle>
|
||||
<DialogContent
|
||||
className="bg-muted max-w-3xl overflow-hidden border-0 p-0"
|
||||
onInteractOutside={e => e.preventDefault()}
|
||||
@@ -262,7 +263,6 @@ const ErrorBoundary = ({
|
||||
let errorTimeout: NodeJS.Timeout;
|
||||
|
||||
const handleError = (event: ErrorEvent) => {
|
||||
event.preventDefault();
|
||||
clearTimeout(errorTimeout);
|
||||
errorTimeout = setTimeout(() => {
|
||||
setError(event.error);
|
||||
|
||||
Reference in new issue
Block a user