System.exit (13) in a groovy script causes Jenkins shutdown

XMLWordPrintable

    • Type: Bug
    • Resolution: Not A Defect
    • Priority: Major
    • Component/s: groovy-plugin
    • None
    • Environment:
      Solaris

      I want to return an error from my groovy script and used for it System.exit(13).It caused shutdown of jenkins.
      The script was startet using jenkins-cli.
      ...
      if(args.length < 2){
      System.exit(13)
      }
      ...

      Finally I found a workaround and use RuntimeException in my script and the job finished as expected as failed. But jenkins cann still continue his work
      ...
      if(args.length < 2)

      { throw new RuntimeException("Mandatory Parameter BRANCH_NAME is missing! Operation ist aborted!") }

      ...

            Assignee:
            vjuranek
            Reporter:
            pan berecik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: