Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14023

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • groovy-plugin
    • None
    • 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!") }

      ...

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

              Created:
              Updated:
              Resolved: