File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ import {
1919 IToolbarWidgetRegistry ,
2020 setToolbar ,
2121 showDialog ,
22- Dialog
22+ Dialog ,
23+ Notification
2324} from '@jupyterlab/apputils' ;
2425import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
2526import {
@@ -39,8 +40,9 @@ import { Widget } from '@lumino/widgets';
3940
4041import { driveBrowserIcon , removeIcon } from '../icons' ;
4142import { Drive } from '../contents' ;
42- import { getContents , setListingLimit } from '../requests' ;
43+ import { getContents , mountDrive , setListingLimit } from '../requests' ;
4344import { CommandIDs } from '../token' ;
45+ import { DrivesResponseError } from '../handler' ;
4446
4547/**
4648 * Status bar widget for displaying drive information
@@ -535,9 +537,23 @@ namespace Private {
535537 ariaLabel : 'Add Drive'
536538 } )
537539 ]
538- } ) . then ( result => {
540+ } ) . then ( async result => {
539541 if ( result . value ) {
540- drive . addPublicDrive ( result . value ) ;
542+ const response = await mountDrive ( result . value , {
543+ provider : 's3'
544+ } ) ;
545+ if ( response && response . error ) {
546+ // Show error in case of failure.
547+ Notification . emit (
548+ ( response . error as DrivesResponseError ) . message ,
549+ 'error' ,
550+ {
551+ autoClose : 5000
552+ }
553+ ) ;
554+ } else {
555+ drive . addPublicDrive ( result . value ) ;
556+ }
541557 }
542558 } ) ;
543559 } ,
You can’t perform that action at this time.
0 commit comments