This repository was archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Error Handling
Roman Baitaliuk edited this page Jan 29, 2018
·
3 revisions
ClusterWS Swift Client provides an easy interface to handle errors.
To handle errors you have to listen delegate method onError
:
func onConnect() {}
func onDisconnect(code: Int?, reason: String?) {}
func onError(error: Error) {
if let error = error as? CWSErrors {
/**
Handling ClusterWS client / server errors
*/
print(error.localizedDescription)
} else {
/**
Handling web socket / connection errors
*/
print(error.localizedDescription)
}
}
We would really appreciate if you give us stars (on all our repositories) this will motivate us to work harder. Thank you very much.