katanemo / arch

Arch is an intelligent prompt gateway. Engineered with (fast) LLMs for the secure handling, robust observability, and seamless integration of prompts with APIs - all outside business logic. Built by the core contributors of Envoy proxy, on Envoy.
https://archgw.com
Apache License 2.0
367 stars 19 forks source link

Send back developer error correctly #195

Closed adilhafeez closed 4 days ago

adilhafeez commented 5 days ago

This PR address the issue of gateway not sending application server errors back correctly. Before this change gateway would send 500 for any developer error. After this change developer should see correct error with error message in the body. Here is a sample 404 received by client that was sent by application server,

HTTP/1.1 404 Not Found
content-type: text/plain
date: Fri, 18 Oct 2024 03:50:37 GMT
server: envoy
transfer-encoding: chunked

63
upstream application error host=api_server, path=/weather, status=404, body={"detail":"some error"}
0

fixes https://github.com/katanemo/arch/issues/176