File tree Expand file tree Collapse file tree 1 file changed +26
-9
lines changed Expand file tree Collapse file tree 1 file changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -149,15 +149,22 @@ export class RecordingsService {
149
149
await this . save ( ) ;
150
150
151
151
}
152
- catch ( error ) {
153
- console . error ( error ) ;
154
- this . mbs . showError ( {
155
- appErrorCode : 'ERR_DB001' ,
156
- error
157
- } ) ;
158
- } ;
152
+ catch ( error : any ) {
153
+ if ( error . code === ErrorCode . ERR_INVALID_URI ) {
154
+ this . selectRecordingsDirectory ( ( ) => this . refreshContent ( ) ) ;
155
+ }
156
+ else {
157
+ console . error ( error ) ;
158
+ this . mbs . showError ( {
159
+ appErrorCode : 'ERR_DB001' ,
160
+ error
161
+ } ) ;
162
+ }
163
+ }
164
+ finally {
165
+ this . refreshProgress . next ( 0 ) ;
166
+ }
159
167
160
- this . refreshProgress . next ( 0 ) ;
161
168
}
162
169
163
170
/**
@@ -388,7 +395,17 @@ export class RecordingsService {
388
395
directoryUri : this . settings . recordingsDirectoryUri ,
389
396
name : DB_FILENAME ,
390
397
} ;
391
- this . settings . dbFileUri = ( await AndroidSAF . getFileUri ( opt ) ) . uri ;
398
+ try {
399
+ this . settings . dbFileUri = ( await AndroidSAF . getFileUri ( opt ) ) . uri ;
400
+ }
401
+ catch ( e : any ) {
402
+ if ( e . code === ErrorCode . ERR_INVALID_URI ) {
403
+ this . settings . dbFileUri = undefined ;
404
+ }
405
+ else {
406
+ throw e ;
407
+ }
408
+ }
392
409
this . settings . save ( ) ;
393
410
}
394
411
You can’t perform that action at this time.
0 commit comments