update axioserror

This commit is contained in:
Proddy
2022-05-01 13:12:40 +02:00
parent 0143e89e27
commit 6b315d52a8
16 changed files with 55 additions and 31 deletions

View File

@@ -21,7 +21,6 @@ const FirmwareFileUpload: FC<UploadFirmwareProps> = ({ uploadFirmware }) => {
/>
)}
<SingleUpload
accept=".bin"
onDrop={uploadFile}
onCancel={cancelUpload}
uploading={uploading}

View File

@@ -17,7 +17,7 @@ const FirmwareRestartMonitor: FC = () => {
try {
await SystemApi.readSystemStatus(POLL_TIMEOUT);
document.location.href = '/firmwareUpdated';
} catch (error: any) {
} catch (error: unknown) {
if (new Date().getTime() < timeoutAt.current) {
setTimeoutId(setTimeout(poll.current, POLL_INTERVAL));
} else {

View File

@@ -106,7 +106,7 @@ const SystemLog: FC = () => {
if (response.status !== 200) {
enqueueSnackbar('Problem applying log settings', { variant: 'error' });
}
} catch (error: any) {
} catch (error: unknown) {
enqueueSnackbar(extractErrorMessage(error, 'Problem applying log settings'), { variant: 'error' });
}
}
@@ -158,7 +158,7 @@ const SystemLog: FC = () => {
const fetchLog = useCallback(async () => {
try {
setLogEntries((await SystemApi.readLogEntries()).data);
} catch (error: any) {
} catch (error: unknown) {
setErrorMessage(extractErrorMessage(error, 'Failed to fetch log'));
}
}, []);

View File

@@ -81,7 +81,7 @@ const SystemStatusForm: FC = () => {
try {
await SystemApi.restart();
enqueueSnackbar('EMS-ESP is restarting...', { variant: 'info' });
} catch (error: any) {
} catch (error: unknown) {
enqueueSnackbar(extractErrorMessage(error, 'Problem restarting device'), { variant: 'error' });
} finally {
setConfirmRestart(false);
@@ -179,7 +179,7 @@ const SystemStatusForm: FC = () => {
try {
await SystemApi.factoryReset();
enqueueSnackbar('Device has been factory reset and will now restart', { variant: 'info' });
} catch (error: any) {
} catch (error: unknown) {
enqueueSnackbar(extractErrorMessage(error, 'Problem factory resetting the device'), { variant: 'error' });
} finally {
setConfirmFactoryReset(false);