Verify valid data (string or object), throw if not valid or empty.