Commit Graph

2 Commits

Author SHA1 Message Date
Varun Gandhi
d7f3e542cf
chore: Replace errors.As with generic As and AsInterface (#63047)
Splits the signature of errors.As into two more specialized functions
which catch more errors at compile-time using generics.
2024-06-04 01:56:55 +00:00
Robert Lin
d75a3733d4
lib/errors: add interfaces for typed errors (#39256)
Introducing custom error types can be tricky - I realized there's no code-level assertions or docs on Is and As implementations, so this PR introduces some interfaces to guide implementers. We write them ourselves because the standard library does not provide them, and it allows us to include docstrings better.
2022-07-25 19:59:14 -04:00