4 Replies Latest reply: Jun 1, 2015 10:49 AM by Marcus Sommer RSS

    ScriptErrorDetails

    Kenny Hua

      Hi,

       

      I try to manage error from my appli and I have a question for ScriptErrorDetails:

       

      Why did he turn "NULL" after an error ?

       

      Data:

      LOAD * INLINE [

      F1

      A

      B

      C

      ];

       

      LET NbRows=NoOfRows('Data');

       

      STORE Datas Into [C:\Temp\Temp.csv] (txt);

       

      TEMP2:

                                First 1 LOAD

                                '$(NbRows)' as NB_ROWS,

                                          '$(ScriptErrorCount)' as ERROR_SEQ_NUMBER,

                                          '$(#ScriptError)' as ERROR_ID,

                                          '$(ScriptError)' as ERROR_NAME,

                                          '$(ScriptErrorDetails)' as ERROR_DETAIL,

                                          '$(ScriptErrorList)' as ERROR_LIST,

                                          now() as ERROR_DATE

                                          RESIDENT Data;    

                                         

      STORE TEMP2 into ../DATA/TABLES/TEMP2.qvd(qvd);  

       

      This way ScripErrorDetails will keep the Error and when the problem come from unnamed fields the error don't stay in ScripErrorDetails.

       

      Regards

        • Re: ScriptErrorDetails
          Peter Cammaert

          This is tricky. You should remember that ScriptError-variables are reset when the next statement is executed.

           

          On the other hand, what exactly should QV tell you about "unnamed fields"?

           

          Peter

          • Re: ScriptErrorDetails
            Kenny Hua

            Hi,

             

            Someone know why ScriptErrorDetails get an error when this error is a "Table not found " and when it's "field not found <A>" ScriptErrorDetails get nothing.

             

            These two parts have the same script:

             

            FIRST 1 CONCATENATE(ERROR) LOAD
            COUNTRY_CODE,
            '$(NbRows)' as NB_ROWS,
            '$(ScriptErrorCount)' as ERROR_SEQ_NUMBER,
            '$(#ScriptError)' as ERROR_ID,
            '$(ScriptError)' as ERROR_NAME,
            '$(ScriptErrorDetails)' as ERROR_DETAIL,
            '$(ScriptErrorList)' as ERROR_LIST,
            now() as ERROR_DATE
            resident DM_P2M_COUNTRY;

             

            The only difference this script is under different script with an error I made:

             

            First: "Table not found" - I store a table who doesn't exist

            Second:  "field not found <AH>" - I changed a field who doesn't exist

             

            Regards