-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Page name: Types
URL: /docs/api/rest-sdk/types
Language: JavaScript
Requested change or enhancement:
-
https://ably.com/docs/api/rest-sdk/types#error-info
The ErrorInfo object's "cause" property says it has a default type of "ErrorInfo" (in the Swift SDK, this is implemented as an "ARTErrorInfo?" type (optional)). Is it intended that ErrorInfo objects should be able to nest recursively? If so, would it be possible to put a bit of explanatory text in there as to how that's meant to work and be used on the client end? -
When trying to deliberately evoke an error with ARTRealtime with MAP_CREATE, I found that this subdomain worked without complaint, when maybe it shouldn't?
let path = "https://dangerismymiddlename.realtime.ably.net/channels/\(channelName)/objects"
-
When trying to deliberately evoke an error with ARTRealtime, the ARTErrorInfo object always seems to return nil, so it seems superfluous for at least the ARTRealtime client (this is harmless, and I understand this might just be a temporary thing while you guys are working on it, so it's no big deal). (BUT on the other hand, the ARTHTTPPaginatedResult does contain a meaningful errorCode and errorMessage, which is great. :) )
-
https://ably.com/docs/api/realtime-sdk/types?lang=swift#paginated-result-example
In this Swift example there is some unsafe code (basically anywhere there's an exclamation mark). Rather than:let paginatedResult = paginatedResult!// <--- If paginatedResult (which is optional) is ever nil, this will crash out 😵
Instead you could write this as:
`guard let paginatedResult` // <-- This will safely unpack the optional, and exit the function gracefully if it's nil
`else { print("No results"); return }`
Thanks! :)