When an image that is too big is uploaded, the server will answer with a 413, which we should handle and show the proper error message. For that reason, we need to add a new ErrorType.
Note: We've discussed ErrorType being a sealed class and the problems that could arise when adding a new ErrorType (Breaking change—it can break the compilation in a when clause). I'll open a different PR for that. #401
Testing Steps
As we are compressing and limiting the maximum size of the final image, it's not easy to test the changes. You have two options:
Closes #352
Description
This PR aims to solve the same issue as https://github.com/Automattic/Gravatar-SDK-iOS/pull/467 in the iOS repo.
When an image that is too big is uploaded, the server will answer with a 413, which we should handle and show the proper error message. For that reason, we need to add a new ErrorType.
Note: We've discussed ErrorType being a sealed class and the problems that could arise when adding a new ErrorType (Breaking change—it can break the compilation in a when clause). I'll open a different PR for that. #401
Testing Steps
As we are compressing and limiting the maximum size of the final image, it's not easy to test the changes. You have two options:
Modifying the code
UCropCropperLauncher
) Gravatar-Android-12-47-55.patchMock the server response
In both options -> Verify you see the error on the avatar picker with the associated message.