I use socektio-swift to do socket connection. But some online users always can not create a socket connection. I print the log which says "Starscream.WSError Error 1". I find socketio-swift use your library. So any advises about this error.
Most of the users are good. Only a few ones get this error. And whatever they do, kill the app, restart the device, all no helpful.
This is a stupid library, and you can't even say I m working on it. Fuck you, sincerely
@AlphaJian needs to check their entitlement, but for anyone hitting this from Google...
The issue is that WSError always gets logged as error 1 because it doesn't adopt either CustomNSError or LocalizedError. I'm not sure if it should adopt LocalizedError at least with the current descriptions it provides since they aren't directed towards end users, but here's what it would look like:
// public enum ErrorType: String, Error { ...
public struct WSError: Error, CustomNSError, LocalizedError {
public let type: ErrorType
public let message: String
public let code: Int
public var errorDescription: String? {
return message
}
public var errorCode: Int {
return code
}
public var errorUserInfo: [String: Any] {
[
"type": type.rawValue
]
}
}
Services like Crashlytics use errorUserInfo so it's always good to map error details into that format.
Most helpful comment
This is a stupid library, and you can't even say I m working on it. Fuck you, sincerely