Commit 856e736 1 parent dc99bba commit 856e736 Copy full SHA for 856e736
File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -941,16 +941,25 @@ export class Repository implements IRemoteRepository {
941
941
if ( this . lastPromptAuth ) {
942
942
await this . lastPromptAuth ;
943
943
}
944
- return keytar . findCredentials ( this . getCredentialServiceName ( ) ) ;
944
+
945
+ try {
946
+ return keytar . findCredentials ( this . getCredentialServiceName ( ) ) ;
947
+ } catch ( error ) {
948
+ return [ ] ;
949
+ }
945
950
}
946
951
947
952
public async saveAuth ( ) : Promise < void > {
948
953
if ( this . canSaveAuth && this . username && this . password ) {
949
- await keytar . setPassword (
950
- this . getCredentialServiceName ( ) ,
951
- this . username ,
952
- this . password
953
- ) ;
954
+ try {
955
+ await keytar . setPassword (
956
+ this . getCredentialServiceName ( ) ,
957
+ this . username ,
958
+ this . password
959
+ ) ;
960
+ } catch ( error ) {
961
+ console . log ( error ) ;
962
+ }
954
963
this . canSaveAuth = false ;
955
964
}
956
965
}
You can’t perform that action at this time.
0 commit comments