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

Make errors more easily 'machine parseable'

XMLWordPrintable

      Currently errors from pipeline JSON to PMD are returned in a textual way that makes it awkward for tools to consume them and display appropriate contextual errors, for example:

      At /pipeline/stages/1/branches/0/steps: Array has 0 entries, requires minimum of 1

      It would be helpful if these errors were split somehow into a location and message, e.g.:

      { location: '/pipeline/stages/1/branches/0/steps', message: 'Array has 0 entries, requires minimum of 1' }
      

      or even:

      { location: [ 'pipeline', 'stages', 1, 'branches', 0, 'steps' ], code: 'EMPTY_ARRAY_NOT_ALLOWED', message: 'Array has 0 entries, requires minimum of 1' }
      

      Or maybe something different.

      This would make it easier for tools to consume without having to parse a potentially volatile (and localized) text format.

            abayer Andrew Bayer
            kzantow Keith Zantow
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: