venmo / DVR

Network testing for Swift
http://blog.soff.es/network-testing-in-swift-with-dvr
MIT License
651 stars 86 forks source link

Added error case #17

Closed RuiAAPeres closed 9 years ago

RuiAAPeres commented 9 years ago

If the status code is outside that range, an error will be passed instead. (otherwise it seems it's always a success)

soffes commented 9 years ago

:-1: It's up to your consumer of DVR to know if it failed or not. This is supposed to just be a mirror of NSURLSession. Since NSURLSession says success if the request worked (even if it's an "error" response code), DVR should do the same.

Also, not a fan of all of the added whitespace :)

RuiAAPeres commented 9 years ago

As a consumer, I would expect that if a cassete as a 404, then an error will come from NSURLSession.

soffes commented 9 years ago

Bottom line: DVR should be indistinguishable from NSURLSession to the consumer. That's DVR's whole purpose.

Sam

On Sun, Aug 9, 2015 at 3:55 PM, Rui Peres notifications@github.com wrote:

As a consumer, I would expect that if a cassete as a 404, then an error will come from NSURLSession.

Reply to this email directly or view it on GitHub: https://github.com/venmo/DVR/pull/17#issuecomment-129258933

hyperspacemark commented 9 years ago

Since NSURLSession says success if the request worked (even if it's an "error" response code), DVR should do the same.

Agreed. DVR shouldn't be making assumptions about what constitutes an error between a client and server.

RuiAAPeres commented 9 years ago

:+1: