Closed adamchel closed 6 years ago
Just modified the PR a little bit to address the concerns in the Slack discussion. There are now three types of errors, and all errors are under the singular StitchError
enum. The comments in the StitchError enum describe the new structure.
@edaniels @jsflax PTAL, along with the new Java PR.
I tried to refactor errors to be as consistent and cohesive as possible. It’s not too many changes, but I did think a lot about it as well as all of the edge cases. I’m happy to clarify anything
The gist of the change is that there now only three types of errors ever thrown by the SDK:
StitchClientError
: errors thrown before a request is madeStitchError
: errors thrown after a request is completed and a response is receivedMain changes:
case unknownError
inStitchError
case requestError
. Instances were either replaced with an appropriateStitchClientError
, or with an appropriateunknownError
.unknownError
andinvalidURL
were removed fromStitchErrorCode
as they aren’t actually Stitch error codes and are now their own appropriate cases in the other error enums.ErrorCodable
, Stitch will return an unknown error with the response body text as the error message.Drive-bys:
try! StitchCore.sync
and replaced withobjc_
stuff.