File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
packages/application-extension/src Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 ISanitizer ,
1717 ISplashScreen ,
1818 IToolbarWidgetRegistry ,
19+ showErrorMessage ,
1920} from '@jupyterlab/apputils' ;
2021
2122import { ConsolePanel } from '@jupyterlab/console' ;
@@ -658,14 +659,23 @@ const title: JupyterFrontEndPlugin<void> = {
658659 return ;
659660 }
660661
661- const result = await renameDialog ( docManager , current . context ) ;
662+ try {
663+ const result = await renameDialog ( docManager , current . context ) ;
662664
663- // activate the current widget to bring the focus
664- if ( current ) {
665- current . activate ( ) ;
666- }
665+ // activate the current widget to bring the focus
666+ if ( current ) {
667+ current . activate ( ) ;
668+ }
667669
668- if ( result === null ) {
670+ if ( result === null ) {
671+ return ;
672+ }
673+ } catch ( error ) {
674+ showErrorMessage (
675+ trans . __ ( 'Rename Error' ) ,
676+ ( error as Error ) . message ||
677+ trans . __ ( 'An error occurred while renaming the file.' )
678+ ) ;
669679 return ;
670680 }
671681
You can’t perform that action at this time.
0 commit comments