Add UX for error Information for Phoenix workspace connection (#1234)

* Add UX for error Information

* update text messages
This commit is contained in:
Karthik chakravarthy
2022-03-30 08:59:37 -04:00
committed by GitHub
parent 8b22027cb6
commit 06f6df83ad
4 changed files with 121 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
/**
* Notebook container related stuff
*/
import { useDialog } from "Explorer/Controls/Dialog";
import promiseRetry, { AbortError } from "p-retry";
import { PhoenixClient } from "Phoenix/PhoenixClient";
import * as Constants from "../../Common/Constants";
@@ -159,6 +160,16 @@ export class NotebookContainerClient {
return null;
} catch (error) {
Logger.logError(getErrorMessage(error), "NotebookContainerClient/resetWorkspace");
if (error?.status === HttpStatusCodes.Forbidden && error.message) {
useDialog.getState().showOkModalDialog("Connection Failed", `${error.message}`);
} else {
useDialog
.getState()
.showOkModalDialog(
"Connection Failed",
"We are unable to connect to the temporary workspace. Please try again in a few minutes. If the error persists, file a support ticket."
);
}
throw error;
}
}