static void ParseCheckSocketConnectException <T> (Exception ex, string[] channels, string[] channelGroups, Action <PubnubClientError> errorCallback, Action <bool> callback) { PubnubErrorCode errorType = PubnubErrorCodeHelper.GetErrorType(ex); int statusCode = (int)errorType; string errorDescription = PubnubErrorCodeDescription.GetStatusCodeDescription(errorType); PubnubClientError error = new PubnubClientError(statusCode, PubnubErrorSeverity.Warn, true, ex.Message, ex, PubnubMessageSource.Client, null, null, errorDescription, string.Join(",", channels), string.Join(",", channelGroups)); GoToCallback(error, errorCallback); LoggingMethod.WriteToLog(string.Format("DateTime {0} checkInternetStatus Error. {1}", DateTime.Now.ToString(), ex.ToString()), LoggingMethod.LevelError); callback(false); }
internal static PubnubClientError CreatePubnubClientError <T>(string message, RequestState <T> requestState, string channel, PubnubErrorCode errorCode, PubnubErrorSeverity severity) { int statusCode = (int)errorCode; string errorDescription = PubnubErrorCodeDescription.GetStatusCodeDescription(errorCode); PubnubClientError error = new PubnubClientError(statusCode, severity, message, PubnubMessageSource.Client, (requestState == null)?null:requestState.Request, (requestState == null)?null:requestState.Response, errorDescription, channel); #if (ENABLE_PUBNUB_LOGGING) LoggingMethod.WriteToLog(string.Format("DateTime {0}, PubnubClientError = {1}", DateTime.Now.ToString(), error.ToString()), LoggingMethod.LevelInfo); #endif return(error); }