catchError's error type should be unknown instead of any #7121
abdulkareemnalband
started this conversation in
Ideas / Feature request
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In best case scenario catchError's callback's
erroras parameter should be typed asunknowninstead asanyIt will force users to handle error more robustly
Its similar to https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
But simply changing
anytounknownis major breaking change. And we also need a proper plan how to do thatIt is not limited to
catchErrorwe also need to do the same forretryWhen,subscribe,tapand otheroperatorsandfunctionswhere we need to work with errorsBeta Was this translation helpful? Give feedback.
All reactions