Implementation
void main() async {
runZonedGuarded(() => runApp(const MiniDashboard()), (error, stack) async {
if (error is SocketException &&
networkErrors.contains(error.osError!.errorCode)) {
models.home.setMessage(
severity: Severity.critical,
text: "Network error, restart by toggling dashboard enabled switch",
);
} else {
models.home.setMessage(
severity: Severity.critical,
text: "Dashboard error. See the logs",
logMessage: false,
);
models.logs.handleLog(
BurtLog(
level: BurtLogLevel.critical,
title: "Dashboard Error",
body: "$error\n$stack",
device: Device.DASHBOARD,
),
display: false,
);
Error.throwWithStackTrace(error, stack);
}
});
}