How to get cfhttp.filecontent when throwonerror = true on cfhttp?

I am making a call to a REST service using cfhttp

with the attribute throwonerror

set to true. When I use the try / catch statement to catch the error, I cannot find a way to output what error the REST service request caused, which would be in a variable cfhttp.filecontent

.

I've also tried putting the result in a variable. Coldfusion keeps telling me that cfhttp and this variable do not exist. It seems that the call and its result kicks out the door when an exception is thrown.

I've read some setup tips throwonerror=false

and capturing status codes myself, but it seems like a silly job. Anyone have any thoughts on this?

<cftry>
    <cfhttp url="#restUrl##arguments.method#/#arguments.params#" charset="utf-8" throwonerror="true" result="haha" />
    <cfcatch type="any">
        <cfdump var="#haha#" />
        <cfdump var="#cfcatch#" abort />
    </cfcatch>
</cftry>

      

UPDATE: I submitted an Adobe bug report as Adamn suggested: https://bugbase.adobe.com/index.cfm?event=newBug . I can confirm that it works on Railo, but not on CF10. Adam could also confirm that he is not working on CF11.

+3


source to share





All Articles