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 {
16
16
ISanitizer ,
17
17
ISplashScreen ,
18
18
IToolbarWidgetRegistry ,
19
+ showErrorMessage ,
19
20
} from '@jupyterlab/apputils' ;
20
21
21
22
import { ConsolePanel } from '@jupyterlab/console' ;
@@ -658,14 +659,23 @@ const title: JupyterFrontEndPlugin<void> = {
658
659
return ;
659
660
}
660
661
661
- const result = await renameDialog ( docManager , current . context ) ;
662
+ try {
663
+ const result = await renameDialog ( docManager , current . context ) ;
662
664
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
+ }
667
669
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
+ ) ;
669
679
return ;
670
680
}
671
681
You can’t perform that action at this time.
0 commit comments