Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
Merged
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
12 changes: 11 additions & 1 deletion src/open-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,17 @@ exports.generateMethod = method => {
opts.method = method.verb.toUpperCase()

// TODO: Use micro-api-client when it supports node-fetch
const response = await fetch(path, opts)
let response
try {
response = await fetch(path, opts)
} catch (e) {
/* istanbul ignore next */
e.name = 'FetchError'
e.url = path
e.data = Object.assign({}, opts)
delete e.data.Authorization
throw e
}

const contentType = response.headers.get('Content-Type')

Expand Down