public ClientError GetClientError(string errorId, string token) { string url; var clientError = new ClientError { TimestampUtc = DateTime.UtcNow, Token = token, MachineName = "TEST-MACHINE-1", UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36", Version = "1.0.0.0", ContextData = new ErrorData { { "Request.HttpMethod", "GET" }, { "Request.Header.Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" }, { "Request.Header.Accept-Encoding", "gzip,deflate,sdch" }, }, ExceptionInfo = GetExceptionInfoFromErrorTemplate(errorId, out url), Messages = new List <LogMessage> { new LogMessage { Message = "This is an example of a log message captured through our Errordite log4net module", TimestampUtc = DateTime.UtcNow }, }, Url = url }; return(clientError); }
public void Start(string host_address, ushort host_port) { _ClientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); bool join = false; try { _ClientSocket.Connect(host_address, host_port); join = true; } catch (Exception ex) { ClientError?.Invoke(new ClientErrorEventArgs(ex, DateTime.Now, this)); join = false; } _Connected = join; if (join) { AsyncObject ao = new AsyncObject(4096); ao.WorkingSocket = _ClientSocket; _ClientSocket.BeginReceive(ao.Buffer, 0, ao.Buffer.Length, SocketFlags.None, _fnReceive, ao); } }
private void ProcessFaceError(WWW www) { //ClientError ex = JsonConvert.DeserializeObject<ClientError>(www.text); ClientError ex = JsonUtility.FromJson <ClientError>(www.text); if (ex.error != null && ex.error.code != null) { string sErrorMsg = !string.IsNullOrEmpty(ex.error.code) && ex.error.code != "Unspecified" ? ex.error.code + " - " + ex.error.message : ex.error.message; throw new System.Exception(sErrorMsg); } else { //ServiceError serviceEx = JsonConvert.DeserializeObject<ServiceError>(www.text); ServiceError serviceEx = JsonUtility.FromJson <ServiceError>(www.text); if (serviceEx != null && serviceEx.statusCode != null) { string sErrorMsg = !string.IsNullOrEmpty(serviceEx.statusCode) && serviceEx.statusCode != "Unspecified" ? serviceEx.statusCode + " - " + serviceEx.message : serviceEx.message; throw new System.Exception(sErrorMsg); } else { throw new System.Exception("Error " + CloudWebTools.GetStatusCode(www) + ": " + CloudWebTools.GetStatusMessage(www) + "; Url: " + www.url); } } }
public static IReadOnlyList <IClientError>?ParseErrors(JsonElement result) { if (result is { ValueKind : JsonValueKind.Array } errors) { var array = new IClientError[errors.GetArrayLength()]; var i = 0; foreach (JsonElement error in errors.EnumerateArray()) { try { array[i] = ParseError(error); } catch (Exception ex) { array[i] = new ClientError( JsonErrorParser_ParseErrors_Error, exception: ex); } i++; } return(array); } return(null); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { Report_Activity.swipeRefreshLayout.Refreshing = false; Report_Activity.swipeRefreshLayout.Enabled = false; base.OnReceivedError(view, errorCode, description, failingUrl); }
public TonClientRustAdapter(string configJson, ILogger <TonClientRustAdapter> logger) { _logger = logger; _logger.LogTrace("Creating context with options: {config}", configJson); using var optionsInteropJson = configJson.ToInteropStringDisposable(); IntPtr resultPtr = RustInteropInterface.tc_create_context(optionsInteropJson); _logger.LogTrace("Reading context creation result"); InteropString resultInterop = RustInteropInterface.tc_read_string(resultPtr); var resultJson = resultInterop.ToString(); RustInteropInterface.tc_destroy_string(resultPtr); _logger.LogTrace("Got context creation result: {result}", resultJson); var createContextResult = JsonSerializer.Deserialize <CreateContextResponse>(resultJson, JsonOptionsProvider.JsonSerializerOptions); if (createContextResult?.ContextNumber == null) { throw new TonClientException($"Raw result: {resultJson}", new NullReferenceException("Result of context creation or context number is null")); } ClientError error = createContextResult.Error; if (error != null) { throw TonClientException.CreateExceptionWithCodeWithData(error.Code, error.Data?.ToObject <Dictionary <string, object> >(), error.Message); } _contextNumber = (uint)createContextResult.ContextNumber; }
/// <summary> /// 异步的发送文本消息。如果发送成功返回true,否则返回false /// </summary> /// <param name="targetUserID">目标用户ID</param> /// <param name="message">文本消息</param> public async Task <bool> SendTextAsync(string targetUserID, string message) { if (ClientState && targetUserID != null && message != null) { return(await Task.Run <bool>(() => { byte[] buffer = BytesConvert.ObjectToBytes(new Transmit() { SourceID = ClientID, TargetID = targetUserID, DataType = DataType.Text, Parameter = message }); try { clientSocket.Send(buffer, buffer.Length, SocketFlags.None); return true; } catch (Exception exception) { ClientError?.Invoke(this, new ClientErrorEventArgs(exception, "在发送文本消息时发生错误")); return false; } })); } return(false); }
public override void OnReceivedError(WebView view, [GeneratedEnum] ClientError errorCode, string description, string failingUrl) { if (failingUrl != _redirectUri) { OnLoadingError?.Invoke(description); } }
private void send(IAsyncResult ar) { AsyncObject ao = (AsyncObject)ar.AsyncState; int sendBytes; try { sendBytes = ao.WorkingSocket.EndSend(ar); } catch (Exception ex) { ClientError?.Invoke(new ClientErrorEventArgs(ex, DateTime.Now, this)); return; } if (sendBytes > 0) { byte[] msgByte = new byte[sendBytes]; Array.Copy(ao.Buffer, msgByte, sendBytes); Message msg = new Message(msgByte); SendMessage?.Invoke(new MessageEventArgs(msg, ao.WorkingSocket)); } }
public static Error GetError(this ClientError clientError, Application application) { var instance = new Error { ApplicationId = application.Id, TimestampUtc = clientError.TimestampUtc.ToDateTimeOffset(application.TimezoneId), MachineName = clientError.MachineName, Url = clientError.Url, UserAgent = clientError.UserAgent, Version = clientError.Version, OrganisationId = application.OrganisationId, ExceptionInfos = GetErrorInfo(clientError.ExceptionInfo).ToArray(), ContextData = clientError.ContextData, Messages = clientError.Messages == null ? null : clientError.Messages.Select(m => new TraceMessage { Message = m.Message, Timestamp = m.TimestampUtc }).ToList() }; //temp thing to move context data to error for clients not updated to latest build if (instance.ContextData == null || instance.ContextData.Count == 0) { MoveContextData(instance); } return(instance); }
public void SerializeAndDeserializeClashOfClansExceptionUsingBinaryFormatter() { // Arrange var error = new ClientError { Message = "message", Reason = "reason" }; var originalException = new ClashOfClansException(error); var formatter = new BinaryFormatter(); using (var ms = new MemoryStream()) { // Act formatter.Serialize(ms, originalException); ms.Position = 0; var deserializedException = (ClashOfClansException)formatter.Deserialize(ms); // Assert Assert.IsNotNull(deserializedException); Assert.AreEqual(originalException.Message, deserializedException.Message); Assert.AreEqual(originalException.Error.Message, deserializedException.Error.Message); Assert.AreEqual(originalException.Error.Reason, deserializedException.Error.Reason); } }
public ReceivedErrorEventArgs(WebView webView, ClientError errorCode, string description, string failingUrl) { this.WebView = webView; this.ErrorCode = errorCode; this.Description = description; this.FailingUrl = failingUrl; }
#pragma warning disable 0672, 618 public override void OnReceivedError(Android.Webkit.WebView view, [GeneratedEnum] ClientError errorCode, string description, string failingUrl) { _webViewSuccess = false; _webErrorStatus = ConvertClientError(errorCode); base.OnReceivedError(view, errorCode, description, failingUrl); }
public override async void OnReceivedError(Android.Webkit.WebView native, [GeneratedEnum] ClientError errorCode, string description, string failingUrl) { await WebView.View.LoadingError.RaiseOn(Thread.Pool, description); base.OnReceivedError(native, errorCode, description, failingUrl); }
// --------------------------------------------------------------------------------- // // processes the error status in response private void ProcessFaceError(HttpWebResponse response) { StreamReader reader = new StreamReader(response.GetResponseStream()); string responseText = reader.ReadToEnd(); //ClientError ex = JsonConvert.DeserializeObject<ClientError>(responseText); ClientError ex = JsonUtility.FromJson <ClientError>(responseText); if (ex.error != null && ex.error.code != null) { string sErrorMsg = !string.IsNullOrEmpty(ex.error.code) && ex.error.code != "Unspecified" ? ex.error.code + " - " + ex.error.message : ex.error.message; throw new System.Exception(sErrorMsg); } else { //ServiceError serviceEx = JsonConvert.DeserializeObject<ServiceError>(responseText); ServiceError serviceEx = JsonUtility.FromJson <ServiceError>(responseText); if (serviceEx != null && serviceEx.statusCode != null) { string sErrorMsg = !string.IsNullOrEmpty(serviceEx.statusCode) && serviceEx.statusCode != "Unspecified" ? serviceEx.statusCode + " - " + serviceEx.message : serviceEx.message; throw new System.Exception(sErrorMsg); } else { throw new System.Exception("Error " + CloudWebTools.GetStatusCode(response) + ": " + CloudWebTools.GetStatusMessage(response) + "; Url: " + response.ResponseUri); } } }
/// <summary> /// 发送一个数据库操作请求。如果发送成功返回true,否则返回false /// </summary> /// <param name="userModel">用户对象</param> /// <param name="operation">操作类型</param> /// <param name="parameter">操作参数</param> public bool SendDatabaseRequest(User user, string operation, string parameter) { if (ClientState) { byte[] buffer = BytesConvert.ObjectToBytes(new Transmit() { SourceID = ClientID, TargetID = ClientID, DataType = DataType.Request, Parameter = $"Database;{operation},{parameter}", Object = user }); SocketAsyncEventArgs args = new SocketAsyncEventArgs(); try { args.SetBuffer(buffer, 0, buffer.Length); clientSocket.SendAsync(args); return(true); } catch (Exception exception) { ClientError?.Invoke(this, new ClientErrorEventArgs(exception, "在发送请求时发生错误")); } finally { args.Dispose(); } } return(false); }
private async Task <TResponse> SendRequestAsync <TRequest, TResponse>(HttpMethod httpMethod, string requestUrl, TRequest requestBody) { var request = new HttpRequestMessage(httpMethod, ServiceHost); request.RequestUri = new Uri(requestUrl); if (requestBody != null) { if (requestBody is Stream) { request.Content = new StreamContent(requestBody as Stream); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); } else if (requestBody is string) { request.Content = new StringContent(requestBody as string); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); } else { request.Content = new StringContent(JsonConvert.SerializeObject(requestBody, s_settings), Encoding.UTF8, JsonHeader); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); } } HttpResponseMessage response = await s_httpClient.SendAsync(request); if (response.IsSuccessStatusCode) { string responseContent = null; if (response.Content != null) { responseContent = await response.Content.ReadAsStringAsync(); } if (!string.IsNullOrWhiteSpace(responseContent)) { return(JsonConvert.DeserializeObject <TResponse>(responseContent, s_settings)); } return(default(TResponse)); } else { if (response.Content != null && response.Content.Headers.ContentType.MediaType.Contains(JsonHeader)) { var errorObjectString = await response.Content.ReadAsStringAsync(); ClientError errorCollection = JsonConvert.DeserializeObject <ClientError>(errorObjectString); if (errorCollection != null) { throw new ClientException(errorCollection, response.StatusCode); } } response.EnsureSuccessStatusCode(); } return(default(TResponse)); }
public static byte[] Serialize(ClientError error) { #if NET2 return Encoding.UTF8.GetBytes(XmlSerialize(error)); #else return Encoding.UTF8.GetBytes(JsonSerialize(error)); #endif }
/// <summary> /// Create a new <see cref="ComputeApiClientException"/>. /// </summary> /// <param name="error"> /// The reason that the exception is being raised. /// </param> /// <param name="messageOrFormat"> /// The exception message or message format. /// </param> /// <param name="innerException"> /// A previous exception that caused the current exception to be raised. /// </param> /// <param name="formatArguments"> /// Optional message format arguments. /// </param> public ComputeApiClientException(ClientError error, string messageOrFormat, Exception innerException, params object[] formatArguments) : base(messageOrFormat, innerException, formatArguments) { Debug.Assert(error != ClientError.Unknown, "Reason.Unknown should not be used here."); Debug.Assert(!String.IsNullOrWhiteSpace(messageOrFormat), "Exception message should not be empty."); _error = error; }
private static TonClientException CreateException(ClientError clientError, Exception innerException, Func <string> errorRawTextFunc) { return(clientError == null ? new TonClientException($"Raw result: {errorRawTextFunc()}", innerException ?? new NullReferenceException("Result of error response is null or not valid")) : TonClientException.CreateExceptionWithCodeWithData(clientError.Code, clientError.Data.ToObject <Dictionary <string, object> >(), clientError.Message)); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { base.OnReceivedError(view, errorCode, description, failingUrl); if (progressDialog != null) { progressDialog.Dismiss(); } }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { base.OnReceivedError(view, errorCode, description, failingUrl); var error = String.Format("Code:{0}, Description: {1}", errorCode, description); AuthenticationEventManager.OnAuthenticationResponseArrived(new AuthenticationResponseEventArgs { Success = false, ErrorMessage = error }); }
public override void OnReceivedError(AWebView view, ClientError errorCode, string description, string failingUrl) { _navigationResult = WebNavigationResult.Failure; if (errorCode == ClientError.Timeout) _navigationResult = WebNavigationResult.Timeout; #pragma warning disable 618 base.OnReceivedError(view, errorCode, description, failingUrl); #pragma warning restore 618 }
private async Task <TResponse> SendMultipartFormRequestAsync <TResponse>(string requestUrl, string[] files, string[] names, NameValueCollection data) { using (MultipartFormDataContent form = new MultipartFormDataContent(("Upload----" + DateTime.Now.Ticks.ToString()))) { //1.1 key/value foreach (string key in data.Keys) { //Content-Disposition : form-data; name="json". var stringContent = new StringContent(data[key]); stringContent.Headers.Add("Content-Disposition", $"form-data; name={key}"); form.Add(stringContent, key); } //1.2 file for (int index = 0; index < files.Length; index++) { var filePath = files[index]; FileStream stream = File.OpenRead(filePath); var streamContent = new StreamContent(stream); streamContent.Headers.Add("Content-Type", "application/octet-stream"); streamContent.Headers.Add("Content-Disposition", $"form-data; name={names[index]}; filename={Path.GetFileName(filePath)}"); form.Add(streamContent, names[index], Path.GetFileName(filePath)); } HttpResponseMessage response = await s_httpClient.PostAsync(requestUrl, form); if (response.IsSuccessStatusCode) { string responseContent = null; if (response.Content != null) { responseContent = await response.Content.ReadAsStringAsync(); } if (!string.IsNullOrWhiteSpace(responseContent)) { return(JsonConvert.DeserializeObject <TResponse>(responseContent, s_settings)); } return(default(TResponse)); } else { if (response.Content != null && response.Content.Headers.ContentType.MediaType.Contains(JsonHeader)) { var errorObjectString = await response.Content.ReadAsStringAsync(); ClientError errorCollection = JsonConvert.DeserializeObject <ClientError>(errorObjectString); if (errorCollection != null) { throw new ClientException(errorCollection, response.StatusCode); } } response.EnsureSuccessStatusCode(); } return(default(TResponse)); } }
/// <summary> /// Initializes a new instance of the <see cref="ClientException"/> class. /// </summary> /// <param name="message">The corresponding error message.</param> /// <param name="innerException">The inner exception.</param> public ClientException(string message, Exception innerException) : base(message, innerException) { Error = new ClientError { Code = HttpStatusCode.InternalServerError.ToString(), Message = message }; }
/// <summary> /// Sends the request asynchronously. /// </summary> /// <typeparam name="TRequest">The type of the request.</typeparam> /// <typeparam name="TResponse">The type of the response.</typeparam> /// <param name="httpMethod">The HTTP method.</param> /// <param name="requestUrl">The request URL.</param> /// <param name="requestBody">The request body.</param> /// <returns>The response.</returns> /// <exception cref="ClientException">The client exception.</exception> private async Task <TResponse> SendRequestAsync <TRequest, TResponse>(HttpMethod httpMethod, string requestUrl, TRequest requestBody = default(TRequest)) { var request = new HttpRequestMessage(httpMethod, requestUrl); if (requestBody != null) { request.Content = new StringContent(JsonConvert.SerializeObject(requestBody, settings), Encoding.UTF8, JsonContentTypeHeader); } HttpResponseMessage response = await httpClient.SendAsync(request); if (response.IsSuccessStatusCode) { string responseContent = null; if (response.Content != null) { responseContent = await response.Content.ReadAsStringAsync(); } if (!string.IsNullOrWhiteSpace(responseContent)) { return(JsonConvert.DeserializeObject <TResponse>(responseContent, settings)); } var properties = new Dictionary <string, string> { { "Page Name", "MessagesController" }, { "Method Name", "SendRequestAsync" }, { "Session Id", telemetry.Context.Session.Id }, { "Http Response", response.IsSuccessStatusCode.ToString() } }; telemetry.TrackEvent("SendRequestAsync Event Views", properties); return(default(TResponse)); } else { if (response.Content != null && response.Content.Headers.ContentType.MediaType.Contains(JsonContentTypeHeader)) { var errorObjectString = await response.Content.ReadAsStringAsync(); ClientError errorCollection = JsonConvert.DeserializeObject <ClientError>(errorObjectString); if (errorCollection != null) { throw new ClientException(errorCollection, response.StatusCode); } } var properties = new Dictionary <string, string> { { "Page Name", "MessagesController" }, { "Method Name", "SendRequestAsync" }, { "Session Id", telemetry.Context.Session.Id }, { "Http Response", response.IsSuccessStatusCode.ToString() } }; telemetry.TrackEvent("SendRequestAsync Event Views", properties); response.EnsureSuccessStatusCode(); } return(default(TResponse)); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { IsLoading = false; base.OnReceivedError(view, errorCode, description, failingUrl); if (ReceivedError != null) { ReceivedError(failingUrl, description, (int)errorCode); } }
private static string CreateErrorMessage(ClientError error, string message) { var builder = new StringBuilder(); builder.AppendLine(error.ToString()); if (!string.IsNullOrEmpty(message)) { builder.AppendLine(message); } return builder.ToString(); }
public void ThrowClashOfClansException() { // Arrange var error = new ClientError(); // Act throw new ClashOfClansException(error); // Assert }
/// <summary> /// Deserialisation constructor for <see cref="ComputeApiClientException"/>. /// </summary> /// <param name="info"> /// A <see cref="SerializationInfo"/> serialisation data store that holds the serialized exception data. /// </param> /// <param name="context"> /// A <see cref="StreamingContext"/> value that indicates the source of the serialised data. /// </param> /// <exception cref="ArgumentNullException"> /// The <paramref name="info"/> parameter is null. /// </exception> /// <exception cref="SerializationException"> /// The class name is <c>null</c> or <see cref="Exception.HResult"/> is zero (0). /// </exception> protected ComputeApiClientException(SerializationInfo info, StreamingContext context) : base(info, context) { if (info == null) { throw new ArgumentNullException("info"); } _error = (ClientError)info.GetValue("_error", typeof(ClientError)); }
/// <summary> /// Initializes a new instance of the <see cref="ClientException"/> class. /// </summary> /// <param name="message">The corresponding error message.</param> /// <param name="httpStatus">The Http Status code.</param> public ClientException(string message, HttpStatusCode httpStatus) : base(message) { HttpStatus = httpStatus; Error = new ClientError { Code = HttpStatus.ToString(), Message = message }; }
/// <summary> /// On error /// </summary> public void OnError(ClientError code, string description) { var hybridWebView = Element as WeavyWebView; if (hybridWebView == null) { return; } hybridWebView.OnLoadError(this, EventArgs.Empty); }
private static string CreateErrorMessage(ClientError error, string message) { var builder = new StringBuilder(); builder.AppendLine(error.ToString()); if (!string.IsNullOrEmpty(message)) { builder.AppendLine(message); } return(builder.ToString()); }
public static string XmlSerialize(ClientError obj) { var stringBuilder = new StringBuilder(); var xmlSerializer = new XmlSerializer(obj.GetType()); using (var xmlTextWriter = new XmlTextWriter(new StringWriter(stringBuilder, CultureInfo.InvariantCulture))) { xmlSerializer.Serialize(xmlTextWriter, obj); } return stringBuilder.ToString(); }
public void Save(ClientError clientError) { try { clientError.ValidateAndThrow(); ClientErrorDao.Save(clientError); } catch (Exception exception) { Logger.Error(exception); throw; } }
public ClientErrorDto Create(ClientErrorDto clientErrorDto) { ClientErrorDto savedErrorDto; using (ITransaction transaction = Session.BeginTransaction()) { ClientError clientError = new ClientError(clientErrorDto.Architecture, clientErrorDto.ClientVersion, clientErrorDto.LineNumber, clientErrorDto.Message, clientErrorDto.OperatingSystem, clientErrorDto.Url); ClientClientErrorManager.Save(clientError); savedErrorDto = ClientErrorDto.Create(clientError); transaction.Commit(); } return savedErrorDto; }
/// <summary> /// Initalizes a new instance of a <see cref="ClientErrorException"/> /// with the specified message and <see cref="ClientError"/>. /// </summary> public ClientErrorException(string message, ClientError error) : base(message) { Error = error; }
public static ClientError GetClientError(Exception exception, IDictionary<string, string> customData) { var clientError = new ClientError { TimestampUtc = DateTime.UtcNow, MachineName = Environment.MachineName, Token = Configuration.Token, Url = HttpContext.Current == null ? null : HttpContext.Current.Request.Url.AbsoluteUri, UserAgent = HttpContext.Current == null ? null : HttpContext.Current.Request.UserAgent, ExceptionInfo = GetExceptionInfo(exception), Messages = HttpContext.Current == null ? null : HttpContext.Current.Items[ErrorditeLogMessagesHttpContextKey] as List<LogMessage>, ContextData = GetCustomData(exception, customData) }; return clientError; }
private static void PostToErrordite(ClientError error, bool async) { if (async) ThreadPool.QueueUserWorkItem(cb => DoPostToErrordite(error)); else DoPostToErrordite(error); }
private static void DoPostToErrordite(ClientError error) { try { Trace("...Sending exception to:={0}", Configuration.Endpoint); ErrorditeWebRequest.To(Configuration.Endpoint) .WithError(error) .TimeoutIn(60) .Send(Configuration.GZip); } catch (Exception ex) { Trace("...Failed to post to Errordite, ", error); try { if (_exceptionNotificationAction != null) _exceptionNotificationAction(ex); } catch { } } }
/** @ingroup errorhandling * @brief Get textual discription of an error message. * * Get a description of an error code posted by either * #OnCmdError or #OnInternalError. * * @param nError The number of the error. * @return A text description of the error. * @see OnCmdError * @see OnInternalError */ public static string GetErrorMessage(ClientError nError) { IntPtr ptr = Marshal.AllocHGlobal(TeamTalk.TT_STRLEN * 2); TTDLL.TT_GetErrorMessage((int)nError, ptr); string s = Marshal.PtrToStringUni(ptr); Marshal.FreeHGlobal(ptr); return s; }
public static ClientErrorDto Create(ClientError clientError) { ClientErrorDto clientErrorDto = Mapper.Map<ClientError, ClientErrorDto>(clientError); return clientErrorDto; }
public ErrorException(ClientError Errno) : base("An error occured") { this.ErrNo = Errno; }
public ClientException(ClientError error, string message, Exception innerEx) : base(CreateErrorMessage(error, message), innerEx) { m_error = error; HResult = (int) (HResults.ClientErrorBase | (uint) error); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { this.OnReceivedError(new ReceivedErrorEventArgs(view, errorCode, description, failingUrl)); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { this.parent.logger.d (FHOAuthWebview.LOG_TAG, "error: " + description + " url: " + failingUrl, null); }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { base.OnReceivedError(view, errorCode, description, failingUrl); var e = new NavigationFailedEventArgs( new Uri(failingUrl), new InvalidOperationException(description) // Do we need to set this exception? WP8 WebView always set it to null ); _Parent.OnNavigationFailed(e); if (e.Handled) { //TODO: Don't render error page } }
public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl) { // base.OnReceivedError(view, errorCode, description, failingUrl); _errorDialogTitle.Text = "Ошибка"; _errorDialogMessage.Text = "Не удалось подключиться. Проверьте состояние интернет подключения."; if (!AppInfo.IsLocaleRu) { _errorDialogTitle.Text = "Error"; _errorDialogMessage.Text = "Internet connection is missing."; } _errorDialogReadyButton.Click += delegate { LoginWebActivity._loginError.Text = description; }; ShowAlertDialog(); _progressDialog.Dismiss(); }
public override void OnReceivedError (WebView view, ClientError errorCode, string description, string failingUrl) { base.OnReceivedError (view, errorCode, description, failingUrl); var error = String.Format ("Code:{0}, Description: {1}", errorCode, description); AuthenticationEventManager.OnAuthenticationResponseArrived (new AuthenticationResponseEventArgs { Success = false, ErrorMessage = error }); }
/// <summary> /// Initializes a new instance of the <see cref="ClientException"/> class. /// </summary> /// <param name="error">The error entity.</param> /// <param name="httpStatus">The http status.</param> public ClientException(ClientError error, HttpStatusCode httpStatus) { this.Error = error; this.HttpStatus = httpStatus; }
private static string JsonSerialize(ClientError error) { var serializer = new JavaScriptSerializer(); return serializer.Serialize(error); }
public ClientException(ClientError error) : this(error, null, null) { }
public ErrorException(ClientError Errno, string message) : base(message) { this.ErrNo = Errno; }
public override void OnReceivedError (WebView view, ClientError errorCode, string description, string failingUrl) { Log.Error (TAG, "Error " + errorCode + ": " + description); Toast.MakeText (view.Context, "Error " + errorCode + ": " + description, ToastLength.Long).Show (); base.OnReceivedError (view, errorCode, description, failingUrl); }
public ErrorditeWebRequest WithError(ClientError error) { _error = error; return this; }