问题描述
我正在尝试使用public async Task Update(T item)
{
using (IDynamoDBContext dbContext = _dataContextFactory.Create())
{
T savedItem = await dbContext.LoadAsync(item);
if (savedItem == null)
{
throw new AmazonDynamoDBException("DynamoService.Update: The item does not exist in the Table");
}
await dbContext.SaveAsync(item);
}
}
或onStatus
记录来自Web客户端的错误响应。我能够基于错误代码引发异常,但无法记录响应。我可以成功记录消息。
下面是我的代码
我尝试使用exchange
方法和.retreive
方法。但是打印的不是来自客户端的打印响应,而是打印以下代码
当前正在响应打印;
.exchange
预期的响应:
checkpoint("Body from POST *****Printing Backend Url ******[DefaultClientResponse]")
当我使用邮递员或soapui时,上述消息从客户端返回
使用.retrieve()方法
{errorCd:404,errorMsg:"Not Found",errorDetails"Person Not Found for Given Request"}
使用.exchange()方法
webClient
.post()
.uri(url)
.header(ACCEPT,APPLICATION_JSON_VALUE)
.bodyValue(request)
.retrieve()
.onStatus({ httpStatus -> HttpStatus.NOT_FOUND == httpStatus },{
logger.info { "Client Response :${it.bodyToMono(String::class.java)}" }
;Mono.error(MyCustomException))
})
.bodyToMono(Person::class.java)
任何帮助都会得到赞赏。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)