Improve error handling of coroutines API #373
This pull request is indented to address the issue #365. This makes the coroutines functions to behave like the standard API regarding how the client should handle errors and exceptions.
To make sure that they're consistent, the
The test suite was also refactored to add missing test cases. Although there are none tests to verify the error handling of serialization/deserialization of
Please, let me know if you have any comments.
* For standard API errors are passed wrapped in FuelError instance * For methods ending with Result the errors are thrown as Exception * Add missing test case for awaitResponse method
* Sort them using the pattern: success test and failure test * Rename them to describe what they are verifying
* Make it throw any exceptions instead of return it * Clean up success test case * Add missing exception handling test case
* Add try/catch block to success case * Rename methods to following the naming pattern * Provide more descriptive failing messages
@@ Coverage Diff @@ ## master #373 +/- ## ============================================ - Coverage 77.14% 77.12% -0.03% Complexity 193 193 ============================================ Files 33 33 Lines 919 918 -1 Branches 154 154 ============================================ - Hits 709 708 -1 Misses 129 129 Partials 81 81
This looks really awesome! Thanks for your contribution!! I think your change makes sense. Regarding to awaitResponse and awaitString, I think they are might be just okay to not have test.
If you don't mind,can you please help show simple usage in (super long) Readme.md so that people can see how it's supposed to be used
Again, thanks you are awesome!!