Bladeren bron

Adds a bit better handling of service issues

Refs: #1911
main
Eric Amodio 2 jaren geleden
bovenliggende
commit
7b4fc949f2
1 gewijzigde bestanden met toevoegingen van 22 en 4 verwijderingen
  1. +22
    -4
      src/plus/subscription/subscriptionService.ts

+ 22
- 4
src/plus/subscription/subscriptionService.ts Bestand weergeven

@ -690,12 +690,30 @@ export class SubscriptionService implements Disposable {
const name = session.account.label;
session = null;
if (ex instanceof AccountValidationError) {
await this.logout();
if (createIfNeeded) {
if (ex instanceof AccountValidationError) {
if (ex.statusCode == null || ex.statusCode < 500) {
await this.logout();
if (createIfNeeded) {
const unauthorized = ex.statusCode === 401;
queueMicrotask(async () => {
const confirm: MessageItem = { title: 'Retry Sign In' };
const result = await window.showErrorMessage(
`Unable to sign in to your (${name}) GitLens+ account. Please try again. If this issue persists, please contact support.${
unauthorized ? '' : ` Error=${ex.message}`
}`,
confirm,
);
if (result === confirm) {
void this.loginOrSignUp();
}
});
}
} else {
void window.showErrorMessage(
`Unable to sign in to your GitLens+ account. Please try again. If this issue persists, please contact support. Account=${name} Error=${ex.message}`,
`Unable to sign in to your (${name}) GitLens+ account right now. Please try again in a few minutes. If this issue persists, please contact support. Error=${ex.message}`,
'OK',
);
}

Laden…
Annuleren
Opslaan