Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Update ky to the latest version 🚀 #1090

Merged
merged 5 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"just-kebab-case": "^1.1.0",
"just-map-keys": "^1.1.0",
"kind-of": "^6.0.2",
"ky": "^0.11.2",
"ky-universal": "^0.2.2",
"ky": "^0.13.0",
"ky-universal": "^0.3.0",
"lru-cache": "^5.1.1",
"multiaddr": "^6.0.6",
"multibase": "~0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function isJsonResponse (res) {
return (res.headers.get('Content-Type') || '').startsWith('application/json')
}

module.exports = async function errorHandler (response) {
module.exports = async function errorHandler (input, options, response) {
if (response.ok) return

let msg
Expand Down
6 changes: 3 additions & 3 deletions test/lib.error-handler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('lib/error-handler', () => {
status: 500
}

const err = await throwsAsync(errorHandler(res))
const err = await throwsAsync(errorHandler(null, null, res))

expect(err.message).to.eql('boom')
expect(err.status).to.eql(500)
Expand All @@ -36,7 +36,7 @@ describe('lib/error-handler', () => {
status: 500
}

const err = await throwsAsync(errorHandler(res))
const err = await throwsAsync(errorHandler(null, null, res))
expect(err instanceof HTTPError).to.be.true()
})

Expand All @@ -48,7 +48,7 @@ describe('lib/error-handler', () => {
status: 500
}

const err = await throwsAsync(errorHandler(res))
const err = await throwsAsync(errorHandler(null, null, res))
expect(err instanceof HTTPError).to.be.true()
})
})