Skip to content

Commit

Permalink
Merge pull request #6 from Maddimax/releases/v2.3
Browse files Browse the repository at this point in the history
Output more error info
  • Loading branch information
Maddimax authored Aug 14, 2024
2 parents a3772a0 + bb32597 commit 6da54d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ describe('action', () => {
}
})

fetchMock.mockResponseOnce(JSON.stringify({}), { status: 400 })
fetchMock.mockResponseOnce('Something went wrong', { status: 400 })
await main.run()
expect(setFailedMock).toHaveBeenCalled()
expect(setFailedMock).toHaveBeenCalledWith(
'HTTP Error: Something went wrong'
)
})
it('Should create a new plugin if not found', async () => {
getInputMock.mockImplementation(name => {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/extensionstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ async function request(
body: data ? JSON.stringify(data) : undefined
})
if (!response.ok) {
throw new Error(`HTTP Error: ${(response.status, response.statusText)}`)
throw new Error(
`HTTP Error: ${(response.status, response.statusText, response.body)}`
)
}
return await response.json()
}
Expand Down

0 comments on commit 6da54d6

Please sign in to comment.