BC3 Error Handling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • turnje
    Visitor
    • Aug 2007
    • 5

    BC3 Error Handling

    I am trying to write a batch file, which will load a session and produce a difference report between to directories.

    This batch file, will use an infile and the /silent option

    Please can someone just clarify the DOS Error handling for me as I can get an errorlevel "9009" if I have an unknown command in the infile, however when I create a "Fatal Scripting Error: Unable to load base folder" error - the DOS Errorlevel is "0".

    The reason I need to confirm the successfull completion is so that I can automate the task using a scheduler tool and want additional actions to be performed based on the completion status.

    Any assistance would be greatly appriciated - thanks
  • Michael Bulgrien
    Carpal Tunnel
    • Oct 2007
    • 1772

    #2
    You can check the %errorlevel% variable in a batch file (command script):

    if %errorlevel%==9009 goto...
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment

    • turnje
      Visitor
      • Aug 2007
      • 5

      #3
      Thanks Michael, but what about the "Fatal Scripting Error: Unable to load base folder", as this returns a DOS Errorlevel of 0, however the script has failed.

      The only other way I can think of is to include a script, which searches the log file for "Fatal Scripting Error" and returns a Errorlevel of 1, however this seams a bit long winded.

      Does BComp.exe not return DOS error codes for fatal error??

      Comment

      • Michael Bulgrien
        Carpal Tunnel
        • Oct 2007
        • 1772

        #4
        Sorry, I guess I missed the crux of your question. Scooter will need to address the error level 0 on a "Fatal Scripting Error". According to the help file, the following DOS Error Levels are set on exit:

        0 - Success
        1 - Binary Match
        2 - Rules-Based Match
        11 - Binary Difference
        12 - Similar
        13 - Rules-Based Difference
        14 - Conflicts Detected
        100 - Unknown error
        101 - Conflicts Detected. Merge output not written.

        I would think that failure to load a file or folder could generate its own errorlevel or, if nothing else, an errorlevel 100.
        BC v4.0.7 build 19761
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 16002

          #5
          Thanks, Michael. The Error Code section in the Help File actually refers to using the /qc or Quick Compare arguements. We do not set error codes for scripting (neither did BC2).

          We're currently working on other projects/issues, but this sounds like a good idea. I'll make a tracker entry for this feature.
          Aaron P Scooter Software

          Comment

          • turnje
            Visitor
            • Aug 2007
            • 5

            #6
            Thanks Aaron / Michael for your help in this matter.

            Comment

            • turnje
              Visitor
              • Aug 2007
              • 5

              #7
              BC3 Error Handling

              Hi Aaron

              Any news on when DOS batchmode error handling will be added to BC3??

              Thanks

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16002

                #8
                It is currently an open entry. It is something we would like to do in a future release, but is not scheduled development.
                Aaron P Scooter Software

                Comment

                • Pete
                  Fanatic
                  • Nov 2007
                  • 190

                  #9
                  Also, it would be nice if we could get a return code from the command line regardless if we call a script or a normal session.

                  Comment

                  • Zoë
                    Team Scooter
                    • Oct 2007
                    • 2666

                    #10
                    The next release will have this fixed. The scripting engine will now return the following exit codes:

                    0: Script successful (no fatal errors). May include non-fatal errors (eg, access denied during a copy)
                    100: Unknown error
                    105: Unable to load script file
                    106: Syntax error
                    107: Unable to load base folder (also includes paths from a FILE-REPORT command)
                    Zoë P Scooter Software

                    Comment

                    • Pete
                      Fanatic
                      • Nov 2007
                      • 190

                      #11
                      Originally posted by Craig
                      The next release will have this fixed. The scripting engine will now return the following exit codes
                      I just did some quick tests and it seems to work nicely, thanks.

                      Comment

                      Working...