Skip to content

Commit b98446a

Browse files
alexr00Copilot
andauthored
Add telemetry error handling for fetching pull request templates (#8697)
Co-authored-by: Copilot <copilot@github.com>
1 parent 69af9f2 commit b98446a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/github/githubRepository.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,18 @@ export class GitHubRepository extends Disposable {
571571
Logger.debug('Fetch pull request templates - done', this.id);
572572
return result.data.repository.pullRequestTemplates.map(template => template.body);
573573
} catch (e) {
574-
// The template was not found.
574+
Logger.error(`Fetching pull request templates failed: ${e}`, this.id);
575+
const properties: { errorCode?: string } = {};
576+
const errorCode = getErrorCode(e);
577+
if (errorCode) {
578+
properties.errorCode = errorCode;
579+
}
580+
/* __GDPR__
581+
"pr.getPullRequestTemplatesFailed" : {
582+
"errorCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
583+
}
584+
*/
585+
this.telemetry.sendTelemetryErrorEvent('pr.getPullRequestTemplatesFailed', properties);
575586
}
576587
}
577588

0 commit comments

Comments
 (0)