Closed ylexus closed 3 years ago
The error is actually descriptive - the file was technically uploaded, but the Library API did not return a usable result (ie. an uploadToken
). This could have different reasons , including an invalid file like in this case. Here the client library is mirroring the behaviour of the Library API itself and is passing through the response.
However - I agree that it would be nicer to fail early, especially for something that would never succeed. I will propose a change to add a check for the file size before an upload request is made. Failing with a IOException
in PhotosLibraryUploadCallable#call()
looks like the best option.
When a file length is zero, uploading it causes this exception:
I think PhotosLibraryUploadCallable should handle it better and fail fast with a more descriptive error.