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

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

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.

Avatar

30-10-2008

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

Avatar

Avatar
Boost 1
Level 1
JacoEng
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
JacoEng
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
JacoEng
Level 1

04-05-2015

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

Avatar

Avatar
Level 1
ID_Mattias
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
ID_Mattias
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
ID_Mattias
Level 1

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