This would be cleaner to simply check for the presence of the key in the body instead of using the exception for validation like this.