Skip to content

Commit d075344

Browse files
committed
Improve error message
1 parent 9f943c1 commit d075344

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

__tests__/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe('action', () => {
185185
})
186186
await main.run()
187187
expect(setFailedMock).toHaveBeenCalledWith(
188-
'HTTP Error: 500, Internal Server Error, '
188+
'HTTP Error: 500, Internal Server Error'
189189
)
190190
})
191191
it('Should create a new plugin if not found', async () => {

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 2 additions & 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ async function request(
173173
body: data ? data : undefined
174174
})
175175
if (!response.ok) {
176+
const errorText = await response.text()
176177
throw new Error(
177-
`HTTP Error: ${response.status}, ${response.statusText}, ${await response.text()}`
178+
`HTTP Error: ${[response.status, response.statusText, errorText].filter(s => s).join(', ')}`
178179
)
179180
}
180181
return await response.json()

0 commit comments

Comments
 (0)