3 Replies Latest reply on Aug 11, 2013 7:43 PM by Varun_Nohria

    Catching a JavaScript exception on LiveCycle Server

    kc@dafolo.dk Level 1

      Occationally Form Developers make mistakes in their Outpu (or input) forms. Hence they introduce the possibility of an exception to be thrown when the form is rendered server side.

       

      How is it possible (server side) to catch these exceptions and report them somewhere - I have not found an exception handler in WorkBench (lightning icon) that handles this.

       

      Hope you understand what I mean?

       

      Thanks in advance

       

      Sincerely

      Kim Christensen

        • 1. Re: Catching a JavaScript exception on LiveCycle Server
          Varun_Nohria Level 1

          Hi Kim,

           

          You can use the renderPDFForms service in workbench. It throws two exceptions:

          - com.adobe.livecycle.formsservice.exception.RenderFormException

          - SYSTEM EXCEPTION

           

          I think if you are execuing java script on the server side and any exceptions comes up, it will be catched in one of the above exceptions.

           

          Also there is one good blog on Handling javascript exceptions:

          http://blogs.adobe.com/formfeed/2009/03/handling_javascript_exceptions.html

           

          Hope this helps.

           

          Regards,

          Varun

          • 2. Re: Catching a JavaScript exception on LiveCycle Server
            kc@dafolo.dk Level 1

            Hi again Varun,

             

            Thanks for replying to this issue.

            In my setup I have to use Output (not Forms) however I believe that the issue remains the same on these two services.

             

            If I do as you suggest (try to catch the JS exception with the two exceptions on the generatePdfOutput service) I get no exceptions inside LC. The generatePDFOutput service just finishes and I see the following in the log:

             

            2013-07-25 09:23:19,548 WARN  [com.adobe.document.XMLFormService] (RequestProcessor-1) ALC-XTG-032-108: [8480] Script failed (language is javascript; context is xfa[0].form[0].form1[0].#subform[0].#subform[1].TextField1[0])

             

            However the potential of a JS script error might be significant. Textfields or sub forms not showing up on the form is a big issue for the end user. However no chance of catching this and report this anywhere in LC?

             

            I hope you understand what I mean - if not please don't hesitate to ask me

             

            Thanks in advance

             

            Sincerely

            Kim Christensen

            • 3. Re: Catching a JavaScript exception on LiveCycle Server
              Varun_Nohria Level 1

              I believe the blog which I attached earlier should be useful in this case.

              If not, request you to attach your sample form?

               

              Regards,

              Varun Nohria