rule-engine - 能否在 IBM ODM 中自定义 HTTP 响应
问题描述
可以在 IBM ODM 中自定义 http 状态代码和消息吗?
我看到我们可以在 ODM 中进行异常处理,但消息会转到错误日志,我看不到自定义 http 响应和消息的方法(链接附加打击) https://www.ibm.com/support/knowledgecenter/SSQP76_8。 10.x/com.ibm.odm.dserver.rules.designer.run/shared_optimizing/tsk_excpt_custom.html
我的分析:
如果我错了,请纠正我
1) 使用 400 和 500 状态码自动处理技术异常,我看不到任何自定义方法
前任:
{
"code": 500,
"message": "An error occurred during the execution of the ruleset. Make sure that the request is valid, and review the ruleset and execution object model if applicable.",
}
{
"code": 404,
"message": "An error occurred during the initialization of the execution, make sure that the ruleset matches the execution requirements.",
"details": "Cannot get the information about the ruleset /project/1.0/service/1.1. Make sure that you have deployed the ruleset and that the enable property is set correctly.\n",
"errorCode": "GBRXH0501E"
}
2)业务异常只能用Http响应200处理,创建额外的异常对象并在其中传递错误代码和消息
前任:
{
"status": null,
"Exception": {
"code": 400,
"message": state 'NJ' does not contain any business logic,
}
}
解决方案
推荐阅读
- python - 一致的 char 到 int
- python - dask应用函数返回数据框:AttributeError:'DataFrame'对象没有属性'name'
- r - R ggplot2 geom_tile 同一个图中的几个图
- javascript - Java 脚本代码无法在 Internet Explorer 中运行,而在 Google Chrome 中运行良好
- javascript - 移动菜单滚动仅禁用/启用一次
- spring-boot - 在zuul后面运行的Springboot微服务没有设置cookies
- paypal - Paypal - 在 php 中获取 onApprove 获取变量
- reactjs - React redux Too many re-renders.React 限制渲染次数防止死循环
- c# - 检索属性的名称和值具有特定的属性值
- python - Python将字符串列表转换为python列表