Closed brendanlensink closed 4 years ago
Yeah, maybe having a generic way to do this is just tilting at windmills. It seems like most of the potential approaches here end up being at least as verbose / gross as just doing what we are now and pulling apart the http error case and manually handling the response Data.
The original bug for this was more driven by me thinking "hey, maybe it would be nice if this were a little more automatic" rather than having a specific use case that would benefit from handling it inside the library, I'm sort of inclined to just say these two experiments demonstrate that this is simple enough that a more general purpose approach isn't actually better, and just close the original bug.
Continuing the discussion from #47.
Adds a new optional field to
Request
,public var expectedErrorResponses: [ExpectedErrorResponse]
This is also a little clunky, but you end up declaring your expected error response handlers in the
Request
constructor.Thoughts? @nbrooke