yelp-ruby icon indicating copy to clipboard operation
yelp-ruby copied to clipboard

Improve error message

Open vsanta opened this issue 9 years ago • 2 comments

Including description of the error in the exception message. This is only included if provided back form the API.

I also standardized the error_spec to have all examples use raise_error.

vsanta avatar Dec 11 '16 17:12 vsanta

@ajm188 statistic preferences are hard to guess (block vs. non-block) :/

The non-block style will not allow the validation of field. This is something that was covered before and I didn't want to remove it.

Otherwise, it would make sense to have it 'should raise an invalid response error' and 'should expose the field parameter'merged with a single assertion

` raise_error(Yelp::Error::InvalidParameter, 'One or more parameters are invalid in request: oauth_token')

Right?In this case it meanfield` is assigned but never tested for.

vsanta avatar Dec 11 '16 21:12 vsanta

statistic preferences are hard to guess (block vs. non-block) :/

I totally feel you on this, but I still want that space in there! :)

The non-block style will not allow the validation of field. This is something that was covered before and I didn't want to remove it.

We're still implicitly testing it, because the field name appears in the error message. But I will defer to @tomelm and @mittonk here, as they have more historical context than I do.

ajm188 avatar Dec 12 '16 00:12 ajm188