place error boundaries closer to the source

This commit is contained in:
Ben Phelps committed 2022-10-05 13:43:22 +03:00
1 parent 88c774339d
commit ea96999377
6 files changed
+31 -21

No files matched your search

+6 -1
View File
@@ -1,5 +1,6 @@
import { useTranslation } from "next-i18next";
import ErrorBoundary from "components/errorboundry";
import components from "widgets/components";
export default function Widget({ service }) {
@@ -8,7 +9,11 @@ export default function Widget({ service }) {
const ServiceWidget = components[service.widget.type];
if (ServiceWidget) {
return <ServiceWidget service={service} />;
return (
<ErrorBoundary>
<ServiceWidget service={service} />
</ErrorBoundary>
);
}
return (