Skip to content

Commit

Permalink
console error when issue reporter fails (microsoft#205920)
Browse files Browse the repository at this point in the history
* throw some console errors here and there

* error checking
  • Loading branch information
justschen authored Feb 22, 2024
1 parent 91f71cd commit 5ca03d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/code/electron-sandbox/issue/issueReporterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ export class IssueReporter extends Disposable {

const response = await fetch(url, init);
if (!response.ok) {
console.error('Invalid GitHub URL provided.');
return false;
}
const result = await response.json();
Expand Down Expand Up @@ -984,6 +985,7 @@ export class IssueReporter extends Disposable {

let issueUrl = hasUri ? this.getExtensionBugsUrl() : this.getIssueUrl();
if (!issueUrl) {
console.error('No issue url found');
return false;
}

Expand All @@ -1004,6 +1006,7 @@ export class IssueReporter extends Disposable {
try {
url = await this.writeToClipboard(baseUrl, issueBody);
} catch (_) {
console.error('Writing to clipboard failed');
return false;
}
}
Expand Down Expand Up @@ -1040,6 +1043,8 @@ export class IssueReporter extends Disposable {
owner: match[1],
repositoryName: match[2]
};
} else {
console.error('No GitHub match');
}

return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ export class NativeIssueService implements IWorkbenchIssueService {
githubAccessToken
}, dataOverrides);

if (issueReporterData.extensionId) {
const extensionExists = extensionData.some(extension => extension.id === issueReporterData.extensionId);
if (!extensionExists) {
console.error(`Extension with ID ${issueReporterData.extensionId} does not exist.`);
}
}

if (issueReporterData.extensionId && this.extensionIdentifierSet.has(issueReporterData.extensionId)) {
ipcRenderer.send(`vscode:triggerReporterMenuResponse:${issueReporterData.extensionId}`, issueReporterData);
this.extensionIdentifierSet.delete(new ExtensionIdentifier(issueReporterData.extensionId));
Expand Down

0 comments on commit 5ca03d6

Please sign in to comment.