Skip to content

Commit 6da54d6

Browse files
authored
Merge pull request #6 from Maddimax/releases/v2.3
Output more error info
2 parents a3772a0 + bb32597 commit 6da54d6

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

__tests__/main.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ describe('action', () => {
149149
}
150150
})
151151

152-
fetchMock.mockResponseOnce(JSON.stringify({}), { status: 400 })
152+
fetchMock.mockResponseOnce('Something went wrong', { status: 400 })
153153
await main.run()
154-
expect(setFailedMock).toHaveBeenCalled()
154+
expect(setFailedMock).toHaveBeenCalledWith(
155+
'HTTP Error: Something went wrong'
156+
)
155157
})
156158
it('Should create a new plugin if not found', async () => {
157159
getInputMock.mockImplementation(name => {

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extensionstore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ async function request(
173173
body: data ? JSON.stringify(data) : undefined
174174
})
175175
if (!response.ok) {
176-
throw new Error(`HTTP Error: ${(response.status, response.statusText)}`)
176+
throw new Error(
177+
`HTTP Error: ${(response.status, response.statusText, response.body)}`
178+
)
177179
}
178180
return await response.json()
179181
}

0 commit comments

Comments
 (0)