Merge branch '16627-add-refresh-button-to-views'
[arvados.git] / src / index.tsx
index 2cee0540862ac2fc9699c043425d850111d90914..d07d3c9e025d870077445af3e79a0078c589a763 100644 (file)
@@ -62,6 +62,7 @@ import { collectionAdminActionSet } from '~/views-components/context-menu/action
 import { processResourceAdminActionSet } from '~/views-components/context-menu/action-sets/process-resource-admin-action-set';
 import { projectAdminActionSet } from '~/views-components/context-menu/action-sets/project-admin-action-set';
 import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
+import { openNotFoundDialog } from './store/not-found-panel/not-found-panel-action';
 
 console.log(`Starting arvados [${getBuildInfo()}]`);
 
@@ -103,15 +104,22 @@ fetchConfig()
             progressFn: (id, working) => {
                 store.dispatch(progressIndicatorActions.TOGGLE_WORKING({ id, working }));
             },
-            errorFn: (id, error) => {
-                console.error("Backend error:", error);
-                store.dispatch(snackbarActions.OPEN_SNACKBAR({
-                    message: `${error.errors
-                        ? error.errors[0]
-                        : error.message}`,
-                    kind: SnackbarKind.ERROR,
-                    hideDuration: 8000})
-                );
+            errorFn: (id, error, showSnackBar) => {
+                if (showSnackBar) {
+                    console.error("Backend error:", error);
+
+                    if (error.errors[0].indexOf("not found") > -1) {
+                        store.dispatch(openNotFoundDialog());
+                    } else {
+                        store.dispatch(snackbarActions.OPEN_SNACKBAR({
+                            message: `${error.errors
+                                ? error.errors[0]
+                                : error.message}`,
+                            kind: SnackbarKind.ERROR,
+                            hideDuration: 8000})
+                        );
+                    }
+                }
             }
         });
         const store = configureStore(history, services);