Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6fbcf8

Browse files
committed
Log the more raw error message from Twirp
1 parent 013b725 commit d6fbcf8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/__tests__/internal/deployment.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ describe('Deployment', () => {
194194
)
195195
expect(core.error).toHaveBeenNthCalledWith(
196196
1,
197+
'Listing artifact metadata failed',
198+
new Error('Failed to ListArtifacts: Received non-retryable error: Failed request: (400) null: yikes!')
199+
)
200+
expect(core.error).toHaveBeenNthCalledWith(
201+
2,
197202
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.',
198203
expect.any(Error)
199204
)
@@ -416,6 +421,11 @@ describe('Deployment', () => {
416421
)
417422
expect(core.error).toHaveBeenNthCalledWith(
418423
1,
424+
'Listing artifact metadata failed',
425+
new Error('Failed to ListArtifacts: Received non-retryable error: Failed request: (501) null: oh no')
426+
)
427+
expect(core.error).toHaveBeenNthCalledWith(
428+
2,
419429
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.',
420430
expect.any(Error)
421431
)

src/internal/api-client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ async function getArtifactMetadata({ artifactName }) {
7070
const twirpResponse = await artifactClient.listArtifacts()
7171
response = wrapTwirpResponseLikeOctokit(twirpResponse, requestOptions)
7272
} catch (twirpError) {
73+
core.error('Listing artifact metadata failed', twirpError)
7374
const octokitError = wrapTwirpErrorLikeOctokit(twirpError, requestOptions)
7475
throw octokitError
7576
}

0 commit comments

Comments
 (0)