http-post - SVC-UTF8SEQ - Invalid UTF-8 escape sequence: 0xf4 0x74

Viewed 58

I use the ML version 10.0-7.3 I have a problem with the http-post return when the host is unknown. I try to catch the error, but it's impossible. Here is the very reduced code :

xquery version "1.0-ml";
let $return := try {xdmp:http-post("http://toto/titi")} catch ($e) { $e}
return $return

and the result in the console is :

*[1.0-ml] SVC-UTF8SEQ: let $return := try { xdmp:http-post("http://toto/titi") } catch ($e) { $e } return $return -- Invalid UTF-8 escape sequence: 0xf4 0x74
Stack Trace
At line 4 column 0:
In xdmp:eval("xquery version &quot;1.0-ml&quot;;&#10;&#10;&#10;let $return := ...", (), <options xmlns="xdmp:eval"><database>17567623539722960267</database>...</options>)
2.
3.
4. l et $return := try {
5. xdmp:http-post("http://toto/titi")}
6. catch ($e)* 
2 Answers

I try on the version : 10.0-8.2 on centos and the catch is OK with the response :

<response xmlns="xdmp:http">
<code>404
</code>
<message>Not Found
</message>
<headers>
<server>nginx/1.14.1
</server>
<date>Mon, 17 Jan 2022 13:07:47 GMT
</date>
<content-type>text/html
</content-type>
<content-length>3971
</content-length>
<connection>keep-alive
</connection>
<etag>"5d9bab28-f83"
</etag>
</headers>
</response>
Related