Currently cake process can return exit code 0 or 1 only.
Will useful if I can return custom Process Exit Code from task.
e.g. throw CakeExitCodeException(-1)
Yip that could be useful, as a workaround you could currently use System.Environment.Exit(-1);

This doesn't have to be a new exception btw. We could add a constructor overload to the CakeException to contain an exit code, since it's always used to indicate a problem within Cake (that will lead to an exit if not handled)
@patriksvensson exactly just an overload constructor with 1 as default.
Most helpful comment
This doesn't have to be a new exception btw. We could add a constructor overload to the CakeException to contain an exit code, since it's always used to indicate a problem within Cake (that will lead to an exit if not handled)