Moves the status code into the exception to avoid hard coded output.