20219: Suppress error toast when process logs fail to load due to 404
authorStephen Smith <stephen@curii.com>
Mon, 21 Aug 2023 16:35:59 +0000 (12:35 -0400)
committerStephen Smith <stephen@curii.com>
Mon, 21 Aug 2023 16:35:59 +0000 (12:35 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/store/process-logs-panel/process-logs-panel-actions.ts

index 844f01542bf7a29e5633f3441c78502ba9f0b12c..87a2fa12aaddc1d6d980908583dfda366c0f1ab4 100644 (file)
@@ -61,7 +61,10 @@ export const initProcessLogsPanel = (processUuid: string) =>
             // On error, populate empty state to allow polling to start
             const initialState = createInitialLogPanelState([], []);
             dispatch(processLogsPanelActions.INIT_PROCESS_LOGS_PANEL(initialState));
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not load process logs', hideDuration: 2000, kind: SnackbarKind.ERROR }));
+            // Only show toast on errors other than 404 since 404 is expected when logs do not exist yet
+            if (e.status !== 404) {
+                dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not load process logs', hideDuration: 2000, kind: SnackbarKind.ERROR }));
+            }
         }
     };