Suggest storing exitCode as a variable, so can include it in the thrown exception.