catchError's error type should be unknown instead of any #7121
abdulkareemnalband
started this conversation in
Ideas / Feature request
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In best case scenario catchError's callback's
error
as parameter should be typed asunknown
instead asany
It will force users to handle error more robustly
Its similar to https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
But simply changing
any
tounknown
is major breaking change. And we also need a proper plan how to do thatIt is not limited to
catchError
we also need to do the same forretryWhen
,subscribe
,tap
and otheroperators
andfunctions
where we need to work with errorsBeta Was this translation helpful? Give feedback.
All reactions