From 19bd5b3b7b6379542af074f031dd6db20a1cb205 Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Mon, 24 Jul 2023 11:40:12 +0100 Subject: [PATCH] better error handling --- src/widgets/octoprint/component.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/octoprint/component.jsx b/src/widgets/octoprint/component.jsx index 3d15e9d0..a897c077 100644 --- a/src/widgets/octoprint/component.jsx +++ b/src/widgets/octoprint/component.jsx @@ -10,8 +10,7 @@ export default function Component({ service }) { const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats"); if (printerStatsError) { - let msg - msg = JSON.parse(new Buffer.from(printerStatsError.resultData.data).toString()); + const msg = JSON.parse(new Buffer.from(printerStatsError.resultData.data).toString()); return (