.Net: Exception handling consistency for FunctionCallContent
class.
#8640
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The
FunctionCallContent.InvokeAsync
method throws exceptions in two cases: if the function invocation fails or the function is not found. However, it does not throw exceptions captured in theException
property that might occur while mapping the function call represented by the AI connector-specific function call model to the connector-agnosticFunctionCallContent
model class.This introduces inconsistency in the way exceptions are handled by the
FunctionCallContent.InvokeAsync
method and may lead to intermittent failures in the calling code that are difficult to troubleshoot and identify the root cause of.Description
This PR throws the function call mapping exception captured by the
Exception
property.Contribution Checklist