better error handling

This commit is contained in:
Karl Hudgell 2023-07-24 11:40:12 +01:00
parent f079bb649a
commit 19bd5b3b7b

View File

@ -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 (
<Container service={service}>
<Block label="OFFLINE" value={msg.error} />