Throw exception if string is not valid