ably-java icon indicating copy to clipboard operation
ably-java copied to clipboard

Extract all Ably status codes in constant class

Open qsdigor opened this issue 2 years ago • 1 comments

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));

┆Issue is synchronized with this Jira Task by Unito

qsdigor avatar Sep 16 '22 07:09 qsdigor

Static constants, perhaps, or enum probably more suited.

QuintinWillison avatar Sep 16 '22 07:09 QuintinWillison