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

Refactor CLI Return code to avoid magical numbers everywhere

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: cli
    • Labels:
      None
    • Similar Issues:

      Description

      Context: JENKINS-32273 introduces better readability of the different error scenario in CLI by catching lots of exceptions. Now the problem is that the different catch are returning error code that are pure integer. It's especially hard to understand / follow / find the meaning of all those values if we are not aware they are listed somewhere.

      Proposed solution: Using an interface as the return type (and keeping the existing method for binary compability) with a standard return code enum implementing the interface for the core and the possibility for plugins to implement their own enum for the custom codes.

      That will allow the future developers to have "easy link" to the description of the code or even directly the meaning by reading the name of the enum that is used.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              wfollonier Wadeck Follonier
              Reporter:
              wfollonier Wadeck Follonier
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: