File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -297,12 +297,17 @@ export class DatabaseUI extends DisposableObject {
297297 }
298298
299299 private handleSetCurrentDatabase = async ( uri : Uri ) : Promise < DatabaseItem | undefined > => {
300- // Assume user has selected an archive if the file has a .zip extension
301- if ( uri . path . endsWith ( '.zip' ) ) {
302- return await importArchiveDatabase ( uri . toString ( true ) , this . databaseManager , this . storagePath ) ;
303- }
300+ try {
301+ // Assume user has selected an archive if the file has a .zip extension
302+ if ( uri . path . endsWith ( '.zip' ) ) {
303+ return await importArchiveDatabase ( uri . toString ( true ) , this . databaseManager , this . storagePath ) ;
304+ }
304305
305- return await this . setCurrentDatabase ( uri ) ;
306+ return await this . setCurrentDatabase ( uri ) ;
307+ } catch ( e ) {
308+ showAndLogErrorMessage ( `Could not set database to ${ path . basename ( uri . fsPath ) } . Reason: ${ e . message } ` ) ;
309+ return undefined ;
310+ }
306311 }
307312
308313 private handleRemoveDatabase = ( databaseItem : DatabaseItem ) : void => {
You can’t perform that action at this time.
0 commit comments