actually incorporate the error message into an exception if invalid