Improved error message on invalid status code
Status code checking