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.