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

feat: add options field and improve formatting of errors #270

Merged
merged 18 commits into from
Aug 23, 2023

Conversation

picunada
Copy link
Contributor

@picunada picunada commented Aug 21, 2023

πŸ”— Linked issue

Issue #265

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

As fetch options extending RequestInit object, it will be more convenient to return FetchOptions object in options field of FetchError object.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

as fetch options extending request object, it will be more convenient to return options object in error instead of request,
as request can be just string if not passed request object, which is not very useful
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #270 (f6c3855) into main (64d3aed) will increase coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #270      +/-   ##
==========================================
+ Coverage   92.20%   92.35%   +0.14%     
==========================================
  Files           5        5              
  Lines         513      523      +10     
  Branches       94       97       +3     
==========================================
+ Hits          473      483      +10     
  Misses         40       40              
Files Changed Coverage Ξ”
src/error.ts 89.87% <100.00%> (+1.30%) ⬆️
src/fetch.ts 96.88% <100.00%> (+0.01%) ⬆️

@picunada picunada changed the title fix(error): changed request object in error to fetch options object feat(error): changed request object in error to fetch options object Aug 21, 2023
@picunada picunada changed the title feat(error): changed request object in error to fetch options object feat(error): if Request is a String return FetchOptions in FetchError request field Aug 21, 2023
src/error.ts Outdated Show resolved Hide resolved
src/error.ts Outdated Show resolved Hide resolved
src/fetch.ts Outdated Show resolved Hide resolved
@picunada picunada changed the title feat(error): if Request is a String return FetchOptions in FetchError request field feat(error): add options filed of type FetchOptions to FetchError object Aug 21, 2023
@picunada picunada changed the title feat(error): add options filed of type FetchOptions to FetchError object feat(error): add options field of type FetchOptions to FetchError object Aug 21, 2023
@picunada picunada requested a review from pi0 August 21, 2023 23:00
@picunada picunada force-pushed the feat/change-request-object-to-options branch from 4b8c15b to 5ec2d80 Compare August 21, 2023 23:30
@picunada
Copy link
Contributor Author

Sorry for amount of commits, I was trying to make codecov working.
It was failing to upload commits(it can be checked in previous gh actions for this PR).
Should we add anything to docs?

@picunada picunada force-pushed the feat/change-request-object-to-options branch from 462d25b to ab9fb9a Compare August 21, 2023 23:42
@pi0
Copy link
Member

pi0 commented Aug 22, 2023

Thanks for recent changes! I might need little bit more time to properly review this on. Planning for next minor release πŸ‘πŸΌ

@pi0 pi0 changed the title feat(error): add options field of type FetchOptions to FetchError object feat: add options field and improve formatting of errors Aug 23, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit b9ef395 into unjs:main Aug 23, 2023
@picunada picunada deleted the feat/change-request-object-to-options branch August 23, 2023 15:05
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