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: reject with real errors for GitLab API calls for better debugging #1465

Merged

Conversation

frantic1048
Copy link
Contributor

In previous implementation, some GitLab API calls would make a Promise rejection with undefined as the reason.
And in the global unhandledRejection handler, it will print a generic "Error: undefined" message.
This makes debugging very hard.

This commit fixes the issue by filling in the rejection reason with the actual error.

In previous implementation, some GitLab API calls would make a Promise rejection with `undefined` as the reason.
And in the [global `unhandledRejection` handler](https://github.com/frantic1048/danger-js/blob/b67d710af4d177d57e7091a742da54a2e9fa37fc/source/commands/utils/sharedDangerfileArgs.ts#L5), it will print a generic "Error: undefined" message.
This makes debugging very hard.

This commit fixes the issue by filling in the rejection reason with the actual error.
@frantic1048 frantic1048 force-pushed the fix/reject-with-real-gitlab-api-errors branch from e680d73 to b62df49 Compare September 24, 2024 07:14
@orta
Copy link
Member

orta commented Sep 24, 2024

Yeah, this makes sense 👍🏻

@orta orta merged commit 491bb0b into danger:main Sep 24, 2024
2 checks passed
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.

2 participants