Skip to content

Commit

Permalink
feat: detailed error state handling
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Apr 6, 2024
1 parent 79a1737 commit 595e074
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ export function formatSearchQueryString(
}

export async function getHtmlUrl(url: string, token: string): Promise<string> {
const response: Issue | IssueComments | PullRequest = (
await apiRequestAuth(url, 'GET', token)
).data;

return response.html_url;
try {
const response: Issue | IssueComments | PullRequest = (
await apiRequestAuth(url, 'GET', token)
).data;
return response.html_url;
} catch (err) {
console.error('Failed to get html url');
}
}

export function getCheckSuiteUrl(notification: Notification) {
Expand Down Expand Up @@ -280,6 +283,10 @@ export async function generateGitHubWebUrl(
}
}

if (!url) {
url;
}

url = addNotificationReferrerIdToUrl(url, notification.id, accounts.user?.id);

return url;
Expand Down

0 comments on commit 595e074

Please sign in to comment.