ably-java
ably-java copied to clipboard
Extract all Ably status codes in constant class
There are a lot of places where Ably status codes are hard coded. This is not a good practice as we should use static variables instead. What I suggest is that we create a new class AblyConstants and specify all ably specific status codes used in the app. There are also comments about errors that will be useful for developers.
This is a sample of the current code implementation
callback.onError(new ErrorInfo("Unexpected link URL format", 500, 50000));
This is the suggested solution
callback.onError(new ErrorInfo("Unexpected link URL format", 500, INTERNAL_ERROR_50000));
Static constants, perhaps, or enum
probably more suited.