How to use the @jupyterlab/apputils.showErrorMessage function in @jupyterlab/apputils

To help you get started, we’ve selected a few @jupyterlab/apputils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dask / dask-labextension / src / clusters.tsx View on Github external
if (JSONExt.deepEqual(update, cluster)) {
      // If the user canceled, or the model is identical don't try to update.
      return Promise.resolve(cluster);
    }

    const response = await ServerConnection.makeRequest(
      `${this._serverSettings.baseUrl}dask/clusters/${id}`,
      {
        method: 'PATCH',
        body: JSON.stringify(update)
      },
      this._serverSettings
    );
    if (response.status !== 200) {
      const err = await response.json();
      void showErrorMessage('Failed to scale cluster', err);
      throw err;
    }
    const model = (await response.json()) as IClusterModel;
    await this._updateClusterList();
    return model;
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / docregistry / src / mimedocument.ts View on Github external
.catch(reason => {
        // Dispose the document if rendering fails.
        requestAnimationFrame(() => {
          this.dispose();
        });
        void showErrorMessage(
          `Renderer Failure: ${this._context.path}`,
          reason
        );
      });
  }
github jupyterlab / jupyterlab-data-explorer / packages / markdownviewer / src / widget.ts View on Github external
try {
      // Do the rendering asynchronously.
      this._isRendering = true;
      await this.renderer.renderModel(mimeModel);
      this._isRendering = false;

      // If there is an outstanding request to render, go ahead and render
      if (this._renderRequested) {
        return this._render();
      }
    } catch (reason) {
      // Dispose the document if rendering fails.
      requestAnimationFrame(() => {
        this.dispose();
      });
      void showErrorMessage(`Renderer Failure: ${context.path}`, reason);
    }
  }
github hadim / jupyter-archive / src / index.ts View on Github external
.catch(reason => {
        console.error(reason);
        showErrorMessage(
          "Fail to read settings for '@hadim/jupyter-archive:archive'",
          reason
        );
      });
github jupyterlab / jupyterlab / packages / filebrowser / src / upload.ts View on Github external
Promise.all(pending).catch(error => {
      showErrorMessage('Upload Error', error);
    });
  };
github legion-platform / legion / legion / jupyterlab-plugin / src / commands / cloud.ts View on Github external
return {
                  value: training.id,
                  text: training.id
                };
              }),
              'Remove training',
              true
            )
            .then(({ value }) =>
              commands.execute(CommandIDs.removeCloudTraining, {
                name: value.value
              })
            );
        }
      } catch (err) {
        showErrorMessage('Can not remove cloud training', err);
      }
    }
  });
github legion-platform / legion / legion / jupyterlab-plugin / src / commands / authorize.ts View on Github external
);
        } else {
          dialogs
            .showLogoutDialog(
              options.state.credentials
                ? options.state.credentials.cluster
                : 'Internal cluster'
            )
            .then(({ button }) => {
              if (button.accept) {
                options.state.setCredentials();
              }
            });
        }
      } catch (err) {
        showErrorMessage('Can not reset cluster authorization', err);
      }
    }
  });
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / filebrowser / src / listing.ts View on Github external
Promise.all(promises).catch(error => {
      showErrorMessage('Error while copying/moving files', error);
    });
  }
github jupyterlab / jupyterlab-data-explorer / packages / launcher / src / index.tsx View on Github external
.catch(err => {
        launcher.pending = false;
        void showErrorMessage('Launcher Error', err);
      });
  };