【发布时间】:2018-05-23 18:02:58
【问题描述】:
我从一个 Web 应用程序发送 Exception 并在另一个应用程序中获取它。
在这种情况下如何从HttpRequestException 获取值?
发送自:
context.Response = new HttpResponseMessage(apiError.StatusCode)
{
Content = new ObjectContent<ApiError>(apiError,
new JsonMediaTypeFormatter(), @"application/json")
};
return context;
进入另一个:
catch (HttpRequestException e)
{
this.logger.LogError(
string.Format("Ошибка запроса {0}", requestUri.AbsoluteUri),
LogCategoryRepository.ApiCashdesk,
e);
throw;
}
【问题讨论】:
标签: c# model-view-controller httpresponsemessage