Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(nuxt): use more specific FetchError for useFetch errors - #7435

Merged
pi0 merged 2 commits into
mainfrom
fix/fetch-error
Sep 12, 2022
Merged

fix(nuxt): use more specific FetchError for useFetch errors#7435
pi0 merged 2 commits into
mainfrom
fix/fetch-error

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#14879

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

In the case of useFetch, errors will almost certainly be of the FetchError type so we can provide a bit more type hinting to the user to avoid the requirement of casting...

📝 Checklist

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

@danielroedanielroe added bug Something isn't working types 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Sep 12, 2022
@danielroe
danielroe requested a review from pi0September 12, 2022 09:10
@danielroedanielroe self-assigned this Sep 12, 2022
@netlify

netlifyBot commented Sep 12, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit711a417
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/631ef7c3214dbb0009c16d25

pi0
pi0 approved these changes Sep 12, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. However, currently, if interceptors fail for example we don't throw a network error. But is fixable for most cases.

@pi0
pi0 merged commit 563cf7c into mainSep 12, 2022
@pi0
pi0 deleted the fix/fetch-error branch September 12, 2022 09:23
This was referenced Sep 14, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't working🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressingtypes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useFetch() incorrectly typed error

2 participants

@danielroe@pi0