'Should a http proxy layer return the http status code of the end point its calling?

I am working on a web proxy layer, where I just invoke an api and pass what ever was passed to me, to another end point, say google. Initially I thought since its a proxy layer, it should return to the client the same http status code that I received from the google end point. But my question is what if my code throws an error, would that also not return a 5xx error? So how does my client know if the error was from the proxy layer or the google end point?

Also we have monitoring where we take 5xx errors more seriously. If I log google returned 5xx error as my 5xx error, it would cause unnecessary alerts.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source