/// <summary> /// Sends an error response to a query request. /// </summary> public void Error(ResError error) { try { RawResponse(JsonUtils.Serialize(new ErrorDto(error))); } catch (Exception ex) { Service.OnError("Error serializing error query response: {0}", ex.Message); RawResponse(ResService.ResponseInternalError); } }
/// <summary> /// Sends an error response to a request. /// </summary> public void Error(ResError error) { try { byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new ErrorDto(error))); RawResponse(data); } catch (Exception ex) { Service.OnError("Error serializing error response: {0}", ex.Message); RawResponse(ResService.ResponseInternalError); } }
internal async Task ExecuteHandler() { try { await Handler.Handle(this); } catch (ResException ex) { if (replied) { Service.OnError("Error in value get request for {0}: {1} - {2}", ResourceName, ex.Code, ex.Message); } else { ErrorResult = new ResError(ex); } } catch (Exception ex) { // Log error and rethrow as only ResExceptions are considered valid behaviour Service.OnError("Error in value get request for {0}: {1}", ResourceName, ex.Message); throw ex; } }
public void Error(ResError error) { Calls.Add(new Call("Error", new object[] { error })); }
public ResException(ResError error, Exception inner) : base(error.Message, inner) { Code = error.Code; ErrorData = error.Data; }
public ErrorDto(ResError error) { Error = error; }
public void Error(ResError error) { reply(); ErrorResult = error; }