fix(ErrorBoundary): Allow for details to be shown in production. (#5504)
Added showErrorDetails to config to allow for details to be shown in various runtime environments.
This commit is contained in:
1 parent
cf8f4aa120
commit
4620cc3acf
4 files changed
+33
-9
No files matched your search
@@ -25,6 +25,7 @@ window.config = {
|
||||
// above, the number of requests can be go a lot higher.
|
||||
prefetch: 25,
|
||||
},
|
||||
showErrorDetails: 'always', // 'always', 'dev', 'production'
|
||||
// filterQueryParam: false,
|
||||
// Defines multi-monitor layouts
|
||||
multimonitor: [
|
||||
|
||||
@@ -128,11 +128,17 @@ const createRoutes = ({
|
||||
];
|
||||
|
||||
function RouteWithErrorBoundary({ route, ...rest }) {
|
||||
const [appConfig] = useAppConfig();
|
||||
const { showErrorDetails } = appConfig;
|
||||
|
||||
history.navigate = useNavigate();
|
||||
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
return (
|
||||
<ErrorBoundary context={`Route ${route.path}`}>
|
||||
<ErrorBoundary
|
||||
context={`Route ${route.path}`}
|
||||
showErrorDetails={showErrorDetails}
|
||||
>
|
||||
<route.children
|
||||
{...rest}
|
||||
{...route.props}
|
||||
|
||||
Reference in new issue
Block a user