Skip to content

Commit 6351511

Browse files
alexr00Copilot
andcommitted
Better error info
Co-authored-by: Copilot <copilot@github.com>
1 parent 61fe37b commit 6351511

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/github/githubRepository.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ export function getErrorCode(e: unknown): string | undefined {
178178
}
179179

180180
if (typeof e.name === 'string' && e.name) {
181-
return e.name;
181+
const message = typeof e.message === 'string' ? e.message : '';
182+
if (e.name !== 'Error') {
183+
return message ? `${e.name}: ${message}` : e.name;
184+
}
185+
if (message) {
186+
return message;
187+
}
182188
}
183189

184190
return undefined;

0 commit comments

Comments
 (0)