Handle file rename errors (#7710)

dependabot/npm_and_yarn/ui-tests/mermaid-11.10.1
Jeremy Tuloup 6 months ago committed by GitHub
parent 0e4fdd1941
commit 5a845dcde0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -16,6 +16,7 @@ import {
ISanitizer,
ISplashScreen,
IToolbarWidgetRegistry,
showErrorMessage,
} from '@jupyterlab/apputils';
import { ConsolePanel } from '@jupyterlab/console';
@ -658,14 +659,23 @@ const title: JupyterFrontEndPlugin<void> = {
return;
}
const result = await renameDialog(docManager, current.context);
try {
const result = await renameDialog(docManager, current.context);
// activate the current widget to bring the focus
if (current) {
current.activate();
}
// activate the current widget to bring the focus
if (current) {
current.activate();
}
if (result === null) {
if (result === null) {
return;
}
} catch (error) {
showErrorMessage(
trans.__('Rename Error'),
(error as Error).message ||
trans.__('An error occurred while renaming the file.')
);
return;
}

Loading…
Cancel
Save