Skip to content

feat: improve output in case of errors during publish#712

Merged
fgreinacher merged 2 commits intomasterfrom
feat/improve-error-output
May 8, 2024
Merged

feat: improve output in case of errors during publish#712
fgreinacher merged 2 commits intomasterfrom
feat/improve-error-output

Conversation

@fgreinacher
Copy link
Contributor

This PR adds the message from the response body to the error if available.

Resolves #684

"PRIVATE-TOKEN": gitlabToken,
},
hooks: {
beforeError: [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (response?.body && response.headers["content-type"] === "application/json") {
const parsedBody = JSON.parse(response.body);
if (parsedBody.message) {
error.message = `Response code ${response.statusCode} (${parsedBody.message})`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fgreinacher fgreinacher requested a review from travi May 7, 2024 14:44
@fgreinacher fgreinacher marked this pull request as ready for review May 7, 2024 14:44
@fgreinacher fgreinacher merged commit 93c6015 into master May 8, 2024
@fgreinacher fgreinacher deleted the feat/improve-error-output branch May 8, 2024 06:11
@github-actions
Copy link

github-actions bot commented May 8, 2024

🎉 This PR is included in version 13.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Catch error "Project must have a description" when creating a release.

2 participants