Highlighted

How to handle errors in FormCalc?

Avatar

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

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
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

Avatar

30-10-2008

Thank you for reply, unfortunately this script only calls the function POST, which must be done via FormCalc. 😞
Highlighted

Avatar

Avatar

JacoEng

Avatar

JacoEng

JacoEng

04-05-2015

7 years since the original post ... has Adobe implemented FormCalc try/catch error handling by now?

Highlighted

Avatar

Avatar

ID_Mattias

Avatar

ID_Mattias

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