Return error if status code wrong