Skip to content

Commit

Permalink
Feat: log error when session folder does not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebonnici committed Apr 8, 2024
1 parent 9890f79 commit 56f5473
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/SidePanel/StartStop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
StartStopButton,
telemetry,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
import fs from 'fs';
import { unit } from 'mathjs';

import { samplingStart, samplingStop } from '../../actions/deviceActions';
Expand Down Expand Up @@ -93,6 +94,14 @@ export default () => {
});

if (mode === 'DataLogger') {
if (!fs.existsSync(sessionFolder)) {
logger.error(
`Temp Disk root folder '${sessionFolder}' does not exists. Change the root directory from the 'Temp Disk' settings in the side panel`
);
setShowDialog(false);
return;
}

const space = Math.max(
0,
await getFreeSpace(diskFullTrigger, sessionFolder)
Expand Down

0 comments on commit 56f5473

Please sign in to comment.