public class MyHttpError { public string ExceptionMessage { get; set; } public string ExceptionType { get; set; } public Exception InnerException { get; set; } public string Message { get; set; } public string MessageDetail { get; set; } public string StackTrace { get; set; } } public class MyException : Exception { private readonly string stackTrace; public MyException(string message, string stackTrace) : base(message) { this.stackTrace = stackTrace; } // You can't set the StackTrace value on System.Exception, but you can override it public override string StackTrace { get { return this.stackTrace; } } } using (HttpClient client = new HttpClient()) { var respTask = client.GetAsync(String.Format("{0}/mvc/api/exception", server)); respTask.Wait(); if (!respTask.Result.IsSuccessStatusCode) { string responseBody = respTask.Result.Content.ReadAsStringAsync().Result; var error = JsonConvert.DeserializeObject<MyHttpError>(responseBody); throw new MyException(error.ExceptionMessage, error.StackTrace); } }