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

Add some error type convenience functions for mocking and inspection #1047

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

jburnham
Copy link
Contributor

Description

Provide the ability to create the RequestError, etc types in other packages with the underlying
Error type. Useful in our code for mocking these error types.

Add the InternalErrorCodeIs to these errors as well to simplify checking the internal codes when
working with these types.

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

Provide the ability to create the `RequestError`, etc types in other packages with the underlying
Error type. Useful in our code for mocking these error types.

Add the `InternalErrorCodeIs` to these errors as well to simplify checking the internal codes when
working with these types.
@github-actions
Copy link
Contributor

github-actions bot commented Aug 17, 2022

changelog detected ✅

@jburnham jburnham marked this pull request as ready for review August 17, 2022 00:58
@jacobbednarz
Copy link
Member

once you add a CHANGELOG, i'm 👍 to this one.

@codecov-commenter
Copy link

Codecov Report

Merging #1047 (fa904bd) into master (6c5ea4a) will increase coverage by 0.95%.
The diff coverage is 64.73%.

@@            Coverage Diff             @@
##           master    #1047      +/-   ##
==========================================
+ Coverage   49.06%   50.01%   +0.95%     
==========================================
  Files         108      115       +7     
  Lines       10428    11040     +612     
==========================================
+ Hits         5116     5522     +406     
- Misses       4200     4347     +147     
- Partials     1112     1171      +59     
Impacted Files Coverage Δ
access_application.go 76.52% <ø> (ø)
access_bookmark.go 72.44% <ø> (ø)
workers_account_settings.go 35.71% <35.71%> (ø)
rulesets.go 35.09% <47.36%> (+7.43%) ⬆️
workers_tail.go 52.00% <52.00%> (ø)
workers_subdomain.go 57.14% <57.14%> (ø)
email_routing_settings.go 60.00% <60.00%> (ø)
email_routing_rules.go 65.64% <65.64%> (ø)
lockdown.go 57.69% <66.00%> (+6.94%) ⬆️
email_routing_destination.go 66.25% <66.25%> (ø)
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jburnham
Copy link
Contributor Author

once you add a CHANGELOG, i'm 👍 to this one.

added

@jacobbednarz jacobbednarz merged commit c6ddc20 into cloudflare:master Aug 18, 2022
@github-actions github-actions bot added this to the v0.48.0 milestone Aug 18, 2022
github-actions bot pushed a commit that referenced this pull request Aug 18, 2022
@jburnham jburnham deleted the easier-error-mocking branch August 18, 2022 23:30
@github-actions
Copy link
Contributor

This functionality has been released in v0.48.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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.

3 participants