krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.
https://www.krakend.io
Apache License 2.0
1.98k stars 452 forks source link

how to display an error message while calling krakend service? #305

Closed devops-wolverine closed 3 years ago

devops-wolverine commented 3 years ago

Hello,

I'm trying to implement krakend in my system. Its successfully working and showing the json response result if the status code is 200. But if there is an error then showing blank instead of json response. In this case, It little difficult to understand what was the error. Is there anyway to return actual message even response is error?

Here is krakend.json { "version": 2, "name": "KrakenD on k8s", "port": 8080, "cache_ttl": {{ marshal .service.ttl }}, "timeout": {{ marshal .service.timeout }}, "extra_config": {{ marshal .service.extra_config }}, "endpoints": [ { "endpoint": "/v1/sample-patient-data", "method": "POST", "backend": [ { "host": [ "http://testapi:8080" ], "method": "POST", "url_pattern": "/patient", "disable_host_sanitize": false } ], "extra_config": { {{ include "jwt_validation.tmpl" }} }, "headers_to_pass": [ "X-user-id" ] } ], "output_encoding": "json" }

Thanks

kpacha commented 3 years ago

check this doc article: https://www.krakend.io/docs/backends/detailed-errors/

github-actions[bot] commented 2 years ago

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.