Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:[2] Unify error objects with GitHub errors. #75

Merged

Conversation

yuichi10
Copy link
Contributor

@yuichi10 yuichi10 commented Mar 4, 2021

Context

Scms are using different error objects and API does not handle GitLab error objects.
e.g. https://github.com/screwdriver-cd/screwdriver/blob/master/plugins/webhooks/index.js#L405

These errors should be handled by API.

Objective

  • Error object has status property instead of code property.
  • Error message use body.error.detail instead of body.error.detail.required

References

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

index.js Outdated
`STATUS CODE ${response.statusCode}: ${JSON.stringify(response.body)}`);
}
checkResponseError(response);
// `STATUS CODE ${response.statusCode}: ${JSON.stringify(response.body)}`);
Copy link
Member

Choose a reason for hiding this comment

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

commented code?

Copy link

Choose a reason for hiding this comment

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

Sorry, We forgot to delete it.

@tkyi tkyi merged commit 1b6c0ee into screwdriver-cd:master Mar 9, 2021
@kkisic kkisic deleted the refact-error-response branch March 12, 2021 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants