Requests#125
Conversation
|
cc @mcwhittemore -- We've been talking about restructuring the code more dramatically here. Do these changes fall in line with where we'd like to get to? I believe test failures represent the PRs-don't-get-credentials issue on Travis. |
|
@rclark - I think this is a good first step before we refactor requests. @JustAboutJeff - can you write a test that covers this use case. Pretty soon we want to clean up the requests code a bunch and a test would help make sure this doesn't regress. |
ecbc299 to
3fc7a3d
Compare
|
@mcwhittemore thanks for the response! I took a stab at writing a test to capture this scenario within the established code style and format. |
|
Thanks! I just cloned your PR to get the tests to run. |
3fc7a3d to
7f2e0ff
Compare
|
@mcwhittemore took another pass at the spec to better capture the "error only" callback scenario the fix addresses. |
|
@JustAboutJeff and @rclark - why not just drop this line? https://github.com/mapbox/dyno/pull/127/files#diff-14b9fbb5b6f7e8905b1fd8b9d01c5946L221 |
|
@rclark - wanna look at #127. I think it solves the problems @JustAboutJeff brought up Trying to match responses from the |
Thanks for creating
dyno!The error handling for
sendCompletelyfirst attempts to check if theresultobject includes aResponsesobject of any value prior to invoking the callback. However, in cases where this property is not present, such as with aValidationExceptionerror, this check results in it's own uncaughtTypeErrorand fails to ever invoke the callback.This change allows for a safer
Responsescheck so that an error may be passed back to the caller as expected.