[ 
https://issues.apache.org/jira/browse/CAMEL-26212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136909#comment-18136909
 ] 

Claus Ibsen commented on CAMEL-26212:
-------------------------------------

PR: https://github.com/apache/camel/pull/29033

AiResourceExecutor now catches the TypeConversionException of the String and 
byte[] conversion and returns the same conversion error as for a null result 
(names the resource, the expected type and the declared mimeType). The 
TypeConversionException is kept as the cause. Test added that fails before the 
fix.

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-ai-resource - a List body with a binary mimeType fails with a 
> misleading argument type mismatch error
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26212
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26212
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ai
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of ai-resource (CAMEL-24961, PR 
> #28401).
> h4. 1. A List body with a binary mimeType fails with "argument type mismatch"
> For a binary {{mimeType}}, {{AiResourceExecutor}} (main 2a465aa4814c, line 
> 107) reads the reply with {{getBody(byte[].class)}}. A {{List}} body makes 
> the type converter throw a {{TypeConversionException}} with "argument type 
> mismatch", which escapes before the {{conversionError}} path (line 109) that 
> would name the resource, the expected type and the declared mimeType. Checked 
> on 4.24.0-SNAPSHOT with routes run through {{AiResourceExecutor}}.
> Proposed: catch the {{TypeConversionException}} and return the same 
> {{conversionError}} as for a null result.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to