socketio / socket.io-client-swift

Other
5.22k stars 843 forks source link

How to get the underlying `NSError` object in an `on:callback:` for event type error, which is printed in the debug console? #1438

Open funnel20 opened 1 year ago

funnel20 commented 1 year ago

The current implementation of on:callback: is that the callback contains an array with data. In case the on event is .error , the array contains a string with the (localised) error description. This is impossible to parse safely, as these strings change per device locale and iOS version.

Is there a way to get the underlying NSError in the callback, so its errors codes can be parsed? The NSError is printed in the debug console, so it is available.