public void HandleException(Exception e, CancellationTokenSource source) { Type exceptionType = e.GetType (); if (exceptionType == typeof(TaskCanceledException)) { TaskCanceledException tce = (TaskCanceledException)e; if (tce.CancellationToken == source.Token) { System.Diagnostics.Debug.WriteLine ("TodoResponse::This is a real cancellation triggered by the caller."); } else { System.Diagnostics.Debug.WriteLine ("TodoResponse::This is a web request time out."); } } response = new TodoResponseMessage (); response.status = "error"; response.message = "Something bad is happening in Oz."; response.payload = null; }
public void Serialize(string content) { response = JsonConvert.DeserializeObject<TodoResponseMessage> (content); }