chore(native-filters): Ensure consistent error handling (#24206)

Co-authored-by: Michael S. Molina <michael.s.molina@gmail.com>
This commit is contained in:
John Bodley
2023-05-30 09:08:38 -07:00
committed by GitHub
parent 6e7b93eb48
commit 674da1b209
5 changed files with 75 additions and 31 deletions

View File

@@ -34,6 +34,7 @@ type Props = {
source?: ErrorSource;
description?: string;
errorMitigationFunction?: () => void;
fallback?: React.ReactNode;
};
export default function ErrorMessageWithStackTrace({
@@ -45,6 +46,7 @@ export default function ErrorMessageWithStackTrace({
stackTrace,
source,
description,
fallback,
}: Props) {
// Check if a custom error message component was registered for this message
if (error) {
@@ -62,6 +64,10 @@ export default function ErrorMessageWithStackTrace({
}
}
if (fallback) {
return <>{fallback}</>;
}
return (
<ErrorAlert
level="warning"