Replies: 1 comment 3 replies
|
We've considered it but it's not clear it actually brings much value and can add more confusion. Certain kinds of exceptions are clear, e.g. OperationCanceledException is used for cancellation. For more generalized "this operation failed", though, it's difficult to meaningfully abstract over it, and you end up routing all exceptions to a single exception type, which for a consumer isn't particularly different from just catching Exception. It's possible we could come up with categorization and have an enum status code or something, but it's not clear what that would look like or whether it would bring meaningful value. Most of the underlying providers don't try to do this, either, e.g. the service sends down an error message but a single exception type surfaces that, without the ability to differentiate other than trying to parse the message and pattern match. |
Uh oh!
There was an error while loading. Please reload this page.
I would like to catch invalid request exceptions from IChatClient.GetResponseAsync but I'm not sure what type to catch. I think it depends on the underlying provider. Would it make sense to make each integration wrap their exceptions in a MEIA type so their implementation don't leak and we have a clear exception to catch?
All reactions