I’m currently just throwing ably-cocoa’s ARTErrorInfo type, with custom error domain and new set of error codes. This is what the JS SDK does. The spec at time of writing also makes mention of errors with numeric codes. If we decide to stick with this approach, then we should expose some API in ably-cocoa to allow creating an ARTErrorInfo with a custom domain and cause, to replace the copied-and-pasted code in init(errorCode:).
We also need to make sure that numeric error codes and status codes are consistent across platforms (the spec doesn't specify the error code or status code for all errors at time of writing).
We might also decide that we wish to not use ARTErrorInfo and instead create something more appropriate to Swift (i.e. that doesn't inherit from NSError).
Update: #45 has introduced other, non-ARTErrorInfo errors such as PaginatedResultError and MessagesError. Need to figure out what to do with those, too. It’s also throwing errors in the ably-cocoa error domain, which we need to revisit.
I’m currently just throwing ably-cocoa’s
ARTErrorInfo
type, with custom error domain and new set of error codes. This is what the JS SDK does. The spec at time of writing also makes mention of errors with numeric codes. If we decide to stick with this approach, then we should expose some API in ably-cocoa to allow creating anARTErrorInfo
with a customdomain
andcause
, to replace the copied-and-pasted code ininit(errorCode:)
.We also need to make sure that numeric error codes and status codes are consistent across platforms (the spec doesn't specify the error code or status code for all errors at time of writing).
We might also decide that we wish to not use
ARTErrorInfo
and instead create something more appropriate to Swift (i.e. that doesn't inherit fromNSError
).Update: #45 has introduced other, non-
ARTErrorInfo
errors such asPaginatedResultError
andMessagesError
. Need to figure out what to do with those, too. It’s also throwing errors in the ably-cocoa error domain, which we need to revisit.┆Issue is synchronized with this Jira Task by Unito