Skip to content

Commit

Permalink
refactor: elaborate errors in Github plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Feb 13, 2024
1 parent 55616db commit 3167180
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/builtin-plugins/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const githubPlugin: PluginConstructor = () => {
const response = await fetch(apiUrl, { headers });
if (!response.ok) {
// convert to http error
throw new Error(response.statusText);
throw new Error(`HTTP ${response.status} ${response.statusText}`);
}

const data = await response.json();
Expand All @@ -47,7 +47,7 @@ export const githubPlugin: PluginConstructor = () => {
}
} catch (error: unknown) {
// TODO: migrate to bunyamin
console.error('Failed to fetch job ID due to error:', error);
console.error(`Failed to fetch job ID from: ${apiUrl}\nReason:`, error);
}

process.env.ALLURE_GITHUB_URL ||= `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;
Expand Down

0 comments on commit 3167180

Please sign in to comment.