You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More information about this can be found in https://request-cancellation-test.vercel.app. What SWR can help here is to provide an ignoreCancellationErrors option which skips onError and onErrorRetry callbacks when an error matches that pattern occurred.
This is helpful for cases like using Sentry to report client errors, or showing a “failed to fetch” hint in the UI. It's very tricky to filter these errors out manually due to the ununified behaviors.
However, there are many concerns about this change. Since we can't avoid the error state being updated, it will mostly be a consistency issue (error is set but onError isn't fired). So should we name it as ignoreCancellationErrorReports or skipCancellationErrorEvents? Or we should provide a shouldIgnoreError: error => boolean option (a filter), and give it a default value?
This discussion was converted from issue #1718 on December 20, 2022 15:30.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
More information about this can be found in https://request-cancellation-test.vercel.app. What SWR can help here is to provide an
ignoreCancellationErrors
option which skipsonError
andonErrorRetry
callbacks when an error matches that pattern occurred.This is helpful for cases like using Sentry to report client errors, or showing a “failed to fetch” hint in the UI. It's very tricky to filter these errors out manually due to the ununified behaviors.
However, there are many concerns about this change. Since we can't avoid the
error
state being updated, it will mostly be a consistency issue (error
is set butonError
isn't fired). So should we name it asignoreCancellationErrorReports
orskipCancellationErrorEvents
? Or we should provide ashouldIgnoreError: error => boolean
option (a filter), and give it a default value?Beta Was this translation helpful? Give feedback.
All reactions