Skip to content

Add converter error information to FunctionInputConverterException #3194

@Duranom

Description

@Duranom

Description

Description

Feature request
When creating creating custom IInputConverters and returning ConversionResult.Failed(exception) the application will throw a FunctionInputConverterException, which for HttpTriggers will result in a 500 internal server error.
Furthermore this exception has no information aside from the message that a source value could not be parsed to a target type, but the exact items details or not available.

For function applications that deal with HttpTriggers it is rather handy to have more information what value was provided and to what type it tried to convert, perhaps even the exception that was supplied with the ConversionResult.Failed(exception).
That way it would be possible to create a middleware that catches the FunctionInputConverterException when it concerns a HttpTrigger and set the invocation result to a badrequest with problem details thus return a 400 Badrequest.

For non-httptriggers it can be beneficial to create a bit more detailed logs.

Current workaround
Currently only a very basic problem details response can be created by attempting to parse the error message and extract the parameter name and type to cast to. One can provide some information but not enrich it, lets say if one used a ValidationException to supply insights and a message or so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions