You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that it looks like API errors are getting logged out properly via a handle() method, but would it make sense to expose these in the method completion as well? Right now, for instance, if a MediaItem upload fails I just receive res as [], or if adding photos to an album fails I just receive false. In my case this is because I'm uploading a lot of photos and getting 429 Quota exceeded API responses, and I'd like to back off and try again. Whereas with other errors, I'd probably want to just give up and show an error message.
I assume it's a bit more complicated by the fact that the failure could be an HTTP status error or it could be something lower down the stack, so I assume we'd either need two extra arguments to the completion (maybe Status? and Error?) or a single Error? that could be switched to either a Status or other type of Error. But I'm not as familiar with Swift error handling best practices so feel free to disregard these suggestions.
The text was updated successfully, but these errors were encountered:
@mnutt thanks for the suggestions. I will try to implement better error handling in the following version. I think returning a Result would be a good way to separate google errors from network errors.
I see that it looks like API errors are getting logged out properly via a
handle()
method, but would it make sense to expose these in the method completion as well? Right now, for instance, if a MediaItem upload fails I just receiveres
as[]
, or if adding photos to an album fails I just receivefalse
. In my case this is because I'm uploading a lot of photos and getting429 Quota exceeded
API responses, and I'd like to back off and try again. Whereas with other errors, I'd probably want to just give up and show an error message.I assume it's a bit more complicated by the fact that the failure could be an HTTP status error or it could be something lower down the stack, so I assume we'd either need two extra arguments to the completion (maybe
Status?
andError?
) or a singleError?
that could be switched to either a Status or other type of Error. But I'm not as familiar with Swift error handling best practices so feel free to disregard these suggestions.The text was updated successfully, but these errors were encountered: