Skip to content

Commit c5d3725

Browse files
author
winjo
committed
style: git error
1 parent 4be8f5a commit c5d3725

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/git/src/git.contribution.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export class GitContribution extends Disposable implements LaunchContribution {
7373
rootFS.umount(this.appConfig.workspaceDir);
7474
},
7575
});
76-
let message = '';
7776
if (isResponseError(err)) {
7877
if (err.name === 'RequestError') {
7978
this.messageService.error(localize('api.request.error'));
@@ -82,7 +81,7 @@ export class GitContribution extends Disposable implements LaunchContribution {
8281
if (err.name === 'ResponseError') {
8382
const status = err.response?.status;
8483
if (status === 401) {
85-
this.reporter.point('gitProject', 'responseError', { status: 401 });
84+
this.reporter.point('gitProject', 'responseError', { status });
8685
const goto = localize('api.login.goto');
8786
this.messageService
8887
.error(localize('api.response.no-login-antcode'), [goto])
@@ -93,11 +92,12 @@ export class GitContribution extends Disposable implements LaunchContribution {
9392
});
9493
return;
9594
}
96-
if (err.response.status === 403) {
97-
this.reporter.point('gitProject', 'responseError', { status: 403 });
95+
let message = '';
96+
if (status === 403) {
97+
this.reporter.point('gitProject', 'responseError', { status });
9898
message = localize('api.response.project-no-access');
99-
} else if (err.response?.status === 404) {
100-
this.reporter.point('gitProject', 'responseError', { status: 404 });
99+
} else if (status === 404) {
100+
this.reporter.point('gitProject', 'responseError', { status });
101101
message = formatLocalize('api.response.project-not-found', this.gitApiService.project);
102102
}
103103
this.messageService.error(message || localize('api.response.unknown-error'));

0 commit comments

Comments
 (0)