Skip to content

Commit

Permalink
fix(github): more verbose error message on release failure
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed Jul 13, 2023
1 parent e1de60f commit 1682899
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Cooker/providers/GithubProvider/createRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,21 @@ export function createRelease(path, tagName, body) {
resolve(response.data)
})
.catch(error => {
reject(new Error(error))
if (error.response) {
let errorInfo = ''
for (const entry in error.response.data) {
errorInfo += `\n ${entry}: '${error.response.data[entry]}'`
}
reject(
new Error(
'Request failed with status code ' +
error.response.status +
errorInfo
)
)
} else {
reject(new Error(error))
}
})
})
.catch(reject)
Expand Down

0 comments on commit 1682899

Please sign in to comment.