Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Conform MoyaError to CustomNSError in addition to LocalizedError #1783
Since the existing version of
My frustration, looking at a run-of-the-mill "handled" error in Bugsnag, when I realized I couldn't determine the key path at which Codable's object mapping had failed.
In this PR branch,
I recognize that an unsolicited PR is less than ideal, and I do apologize. This is something I thought I ought to do while I had the spare minutes and the inspiration.
If this gets closed, so be it — "the people have spoken." Just thought I'd offer, since it's not a whole ton of code, and I don't think I'm the only person whose time it could save.
Always recommend opening an issue but nonetheless thanks for the PR
I'm definitely a little skeptical about modifying Moya for better integration with other libraries that use
If I'm reading this right (I'm not familiar with
@Moya/contributors do you have any input here?
Dec 20, 2018
AndrewSB left a comment •
Overall, I think we should probably add this. I don't see the downside of adding better support for NSErrors. If this broke linux support, I'd feel differently.
I think it would be better if this wasn't a breaking change, just an additive one though.
Updated with a solution that accomplishes what the PR originally set out to do with a smaller diff and less convoluted code.
API-wise, to the best of my knowledge, this is purely additive. If there's anything now that anyone feels should have comments with links to the docs on error bridging, let me know, I've got 'em on deck.
@@ Coverage Diff @@ ## development #1783 +/- ## ============================================ Coverage 90.83% 90.83% ============================================ Files 5 5 Lines 131 131 ============================================ Hits 119 119 Misses 12 12
@dpoggi Thanks a lot for contributing to Moya! We've invited you to join