Skip to content

Commit

Permalink
Log the more raw error message from Twirp
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Dec 22, 2023
1 parent 013b725 commit d6fbcf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/__tests__/internal/deployment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ describe('Deployment', () => {
)
expect(core.error).toHaveBeenNthCalledWith(
1,
'Listing artifact metadata failed',
new Error('Failed to ListArtifacts: Received non-retryable error: Failed request: (400) null: yikes!')
)
expect(core.error).toHaveBeenNthCalledWith(
2,
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.',
expect.any(Error)
)
Expand Down Expand Up @@ -416,6 +421,11 @@ describe('Deployment', () => {
)
expect(core.error).toHaveBeenNthCalledWith(
1,
'Listing artifact metadata failed',
new Error('Failed to ListArtifacts: Received non-retryable error: Failed request: (501) null: oh no')
)
expect(core.error).toHaveBeenNthCalledWith(
2,
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.',
expect.any(Error)
)
Expand Down
1 change: 1 addition & 0 deletions src/internal/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async function getArtifactMetadata({ artifactName }) {
const twirpResponse = await artifactClient.listArtifacts()
response = wrapTwirpResponseLikeOctokit(twirpResponse, requestOptions)
} catch (twirpError) {
core.error('Listing artifact metadata failed', twirpError)
const octokitError = wrapTwirpErrorLikeOctokit(twirpError, requestOptions)
throw octokitError
}
Expand Down

0 comments on commit d6fbcf8

Please sign in to comment.