Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Is there a global error event handler?

user39159662
Level 2
Level 2

Hi,

Is there in LiveCycle Designer an event which is similar to the window.onerror​ event handler?

That is, an event which is fired in case of unhandled exceptions.

Thank you!

1 Accepted Solution
Magus069
Correct answer by
Level 10
Level 10

Here is a sample from Adobe Blogs Handling JavaScript Exceptions

Hope this help

View solution in original post

6 Replies
_Bruce_Robertson
Level 10
Level 10

Hi

I don't believe there is such a thing in a LiveCycle Designer form.

Maybe if you can explain the scenario more we could suggest an alternative.

Regards

Bruce

user39159662
Level 2
Level 2

Hi Bruce,

I don't have a specific scenario in mind.

Though, I am investigating the error logging and error reporting possibilities within LiveCycle Designer forms.

For example, if there is an unhandled error in the code, I am curious if I can "catch" it globally, inform the user ("Something is wrong with this form, please contact support") and possibly log the error in a file.

Magus069
Correct answer by
Level 10
Level 10

Here is a sample from Adobe Blogs Handling JavaScript Exceptions

Hope this help

View solution in original post

user39159662
Level 2
Level 2

Thank you to both of you!

I have my answers now.

There is no global error handler, but I can nevertheless wrap most of the code in a "global" try / catch ("catch them all"), which is fine for me.

_Bruce_Robertson
Level 10
Level 10

Hi, Just thought it might worth pointing out that you could write a macro to add the try/catch block to your code.  There is an example of a macro that adds enter/exit console.println statements in the same blog Add Trace to Form Script  which I've found useful in working out whats going in at times.

user39159662
Level 2
Level 2

At the moment I think I prefer to add the try/catch blocks manually, but this may change.

Thank you for the article, it's quite useful indeed.