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

RunnerAbortedException no longer workin in RunListener.onStartup()

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Trivial Trivial
    • core
    • None
    • Linux

      Trying to abourt a build by throwing Run.RunnerAbortedException() in a RunListener.onStarted().
      This used to work in older version 1.466.
      Use case: I want to enforce certain conventions in all the jobs. If a job doesn't follow the convention, it will always fail. This gives job owners a natural incentive to adhere to the convention.

      RunListener.fireStarted() seems to eat any exception (by just reporting it):
      https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/listeners/RunListener.java#L198

      Run.execute() never sees the exception:
      https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L1574

      Seems like a bug to me. RunListener.fireStarted() should somehow rethrow these exceptions.

            kohsuke Kohsuke Kawaguchi
            m2spring Max Spring
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: