washcroft opened a new issue, #56:
URL: https://github.com/apache/apisix-python-plugin-runner/issues/56
Hello,
What is the intended behaviour of a plugin raising an exception?
e.g.
```
"plugins": {
"ext-plugin-pre-req": {
"allow_degradation": false,
"conf": [
{
"name": "netsuite-authenticator",
"value": "this is invalid json config"
}
]
}
}
```
```
def config(self, conf: Any) -> Any:
"""
Parse plugin configuration
:param conf:
:return:
"""
try:
conf_json = json.loads(conf)
except ValueError as e:
raise Exception("Configuration is invalid json")
return conf_json
```
```
2022-10-07 07:11:42,257 - INFO - request type:2, len:1792
2022-10-07 07:11:42,260 - ERROR - execute plugin `netsuite-authenticator`
AnyError, ('Configuration is invalid json',)
2022-10-07 07:11:42,260 - INFO - response type:2, len:16
```
In this case **apisix ignores the plugin and continues with the request to
the upstream**. I would prefer the ability to control this behaviour.
I was expecting `allow_degredation` in apisix config to control the
behaviour, but it seems this only apply to the plugin runner process itself,
not errors from the plugin.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]