Apigee fault handling for CLASSIFICATION_FAILURE

旧城冷巷雨未停 提交于 2019-12-13 02:59:06

问题


In Apigee, can fault handling - specifying a FaultRule and a RaiseFault policy be used to handle and provide a custom message for:

{
    "fault": {
        "faultstring": "Not Found",
        "detail": {
            "errorcode": "CLASSIFICATION_FAILURE"
        }
    }
}

If this can be done, should the 'Condition' for the fault rule be 'fault.name = "CLASSIFICATION_FAILURE"'? I tried this and it is not working.


回答1:


CLASSIFICATION_FAILURE is a system level failure to find an API Proxy for the given URL/URI. The request will not even reach the API proxy(hence the policies) - which is the precise complaint by the system. So you do not want to handle an error like that.

Another way to approach this case is to have a catch all API proxy with basepath /** which will be invoked when there is no specific URL match. You can generate a custom message in this proxy - this can be the message you wanted to send across in case of classification failure.




回答2:


Srikanth's answer on 30/05/2014 is only partially correct. Using a basepath /** did not work for us. Instead, we had to create an api proxy with basepath = /

Inside the proxy, we defined a RaiseFault in Preflow and that was it.



来源:https://stackoverflow.com/questions/23944470/apigee-fault-handling-for-classification-failure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!