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

API error message improvement

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin
    • tethys

      Ad discussed with cliffmeyers, in creation flow, UI wants to have fine grain control over API returned error message so that it can distinguish different errors with code across fields.

      At present, API returns error message in the format:

      {
           "code": 401,
           "message": "Wrong password",
            "errors":[{
                    "field":"password",
                }]
            }
      

      errors field should include code and message field to have error per field that resulted in validation error. It should look something like:

      {
           "code": 401,
           "message": "Login failed",
            "errors":[{
                    "field":"password",
                    "code": "INVALID",
                   "message":"Wrong password"
                }]
            }
      

      This fix should also formalize field naming patterns so that UI can relate field value with the element in request json object graph.

            vivek Vivek Pandey
            vivek Vivek Pandey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: