mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-11 17:28:10 +01:00
better error handling
This commit is contained in:
parent
f079bb649a
commit
19bd5b3b7b
@ -10,8 +10,7 @@ export default function Component({ service }) {
|
|||||||
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
||||||
|
|
||||||
if (printerStatsError) {
|
if (printerStatsError) {
|
||||||
let msg
|
const msg = JSON.parse(new Buffer.from(printerStatsError.resultData.data).toString());
|
||||||
msg = JSON.parse(new Buffer.from(printerStatsError.resultData.data).toString());
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block label="OFFLINE" value={msg.error} />
|
<Block label="OFFLINE" value={msg.error} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user