This code here:
|
except Exception as e: |
|
# Handle any errors during the request |
|
if log: |
|
log.error(f"An error occurred: {e.__class__.__name__}: {e}") |
|
return |
It should actually return a 500 error with a simple HTML page saying roughly what went wrong.
There are actually a few relevant HTTP errors here:
502 Bad Gateway - if it gets a "bad response" of some sort from the backend (not sure what the definition of "bad" there should be).
504 Gateway Timeout - if the backend times out. Having a timeout setting would be useful generally.
503 Service Unavailable - backend server is unavailable.
I'm not sure how to decide between a 502 and a 503.
This code here:
asgi-proxy-lib/asgi_proxy/__init__.py
Lines 75 to 79 in 0730e87
It should actually return a 500 error with a simple HTML page saying roughly what went wrong.
There are actually a few relevant HTTP errors here:
502 Bad Gateway- if it gets a "bad response" of some sort from the backend (not sure what the definition of "bad" there should be).504 Gateway Timeout- if the backend times out. Having a timeout setting would be useful generally.503 Service Unavailable- backend server is unavailable.I'm not sure how to decide between a 502 and a 503.