Highlighted

How to handle errors in FormCalc?

Avatar

Guest

26-10-2008

I have an XFA form, that communicates with Web service via FormCalc function

post(Url, Request, "text/xml", "utf-8").

When the Web service returns an exception message or the form could not connect to Web service, it shows a messagebox with "Script failed ..."



Is there something like try/catch in FormCalc to handle these errors so that I could show my custom message instead of showing this not-userfriendly error message?

Replies

Highlighted

pguerett

27-10-2008

FormCalc does not have such a thing .....I woudl translate your script over to Javascript where there is a try/catch structure.
Highlighted
Highlighted
Highlighted

ID_Mattias

13-10-2015

I'm wondering about this as well. If I do:

var responseMsg = Post(apiUrl, body, format);

And everything is fine,then I get a json respomse with "success": true etc, but when something is wrong with my post to the API I get a popup error saying something like "Script failed (language is formcalc; context is... and Error: Error attempting to read from file https:// and so on. Really great exception handling there