Simplify error catching

This commit is contained in:
Michael Shamoon
2022-11-18 15:24:07 -08:00
parent 00163d2f44
commit 8a783ba9f6
41 changed files with 93 additions and 113 deletions
+2 -3
View File
@@ -7,9 +7,8 @@ export default function Component({ service }) {
const { data: statsData, error: statsError } = useWidgetAPI(widget, "request/count");
if (statsError || statsData?.error) {
const finalError = statsError ?? statsData.error;
return <Container error={finalError} />;
if (statsError) {
return <Container error={statsError} />;
}
if (!statsData) {