// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import { Dialog, showDialog } from '@jupyterlab/apputils'; import * as React from 'react'; /** * Show a dialog box reporting an error during installation of an extension. * * @param name The name of the extension * @param errorMessage Any error message giving details about the failure. */ export function reportInstallError(name: string, errorMessage?: string) { let entries = []; entries.push(

An error occurred installing {name}.

); if (errorMessage) { entries.push(

Error message:

,
{errorMessage.trim()}
); } let body =
{entries}
; void showDialog({ title: 'Extension Installation Error', body, buttons: [Dialog.warnButton({ label: 'OK' })] }); }