Skip to content

Commit c4a7a6b

Browse files
committed
Wrap everything in the fallback just in case
1 parent 7dfa14a commit c4a7a6b

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

src/routes/Extruder.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
import { Box, Typography, useTheme } from "@mui/material";
22
import { ReadOnlyInputs } from "components/ReadOnlyInputs";
33
import { ParamsPanel } from "screens/CollectionPanel";
4+
import { ErrorBoundary } from "react-error-boundary";
5+
import { FallbackScreen } from "screens/FallbackScreen";
46

57
export function Extruder() {
68
const theme = useTheme();
79
return (
8-
<Box marginTop={2}>
9-
<Typography
10-
variant="h1"
11-
sx={{
12-
color: theme.palette.info.main,
13-
fontSize: 24,
14-
fontWeight: "fontWeightBold",
15-
}}
16-
>
17-
Extruder Data Collection Setup
18-
</Typography>
19-
<ReadOnlyInputs
20-
visit="ca://BL24I-MO-IOC-13:GP1"
21-
detector="ca://BL24I-MO-IOC-13:GP15"
22-
/>
23-
<ParamsPanel expt="extruder" />
24-
</Box>
10+
<ErrorBoundary fallback={<FallbackScreen />}>
11+
<Box marginTop={2}>
12+
<Typography
13+
variant="h1"
14+
sx={{
15+
color: theme.palette.info.main,
16+
fontSize: 24,
17+
fontWeight: "fontWeightBold",
18+
}}
19+
>
20+
Extruder Data Collection Setup
21+
</Typography>
22+
<ReadOnlyInputs
23+
visit="ca://BL24I-MO-IOC-13:GP1"
24+
detector="ca://BL24I-MO-IOC-13:GP15"
25+
/>
26+
<ParamsPanel expt="extruder" />
27+
</Box>
28+
</ErrorBoundary>
2529
);
2630
}

src/screens/CollectionPanel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { Box, Typography } from "@mui/material";
22
import { CollectionSetupFt } from "components/FixedTarget/CollectionSetupFt";
33
import { CollectionSetupEx } from "components/Extruder/CollectionSetupEx";
4-
4+
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
55
type ExptType = {
66
expt: "extruder" | "fixed-target" | "jf";
77
};
88

99
function FallbackScreen() {
1010
return (
11-
<Box>
11+
<Box alignContent={"center"}>
12+
<ErrorOutlineIcon color="error" fontSize="large" />
1213
<Typography component="h1" variant="h4">
1314
Page currently unavailable
1415
</Typography>

0 commit comments

Comments
 (0)