502 Bad Gateway instead of just 500 error
This commit is contained in:
parent
6864ec843c
commit
49f10cb89a
@ -113,14 +113,15 @@ def site_dispatch(env, start_response):
|
|||||||
yield error_code('404 Not Found', start_response)
|
yield error_code('404 Not Found', start_response)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
except (socket.error, ConnectionAbortedError) as e:
|
except socket.error as e:
|
||||||
start_response('500 Internal Server Error', ())
|
start_response('502 Bad Gateway', ())
|
||||||
print(str(e))
|
print(str(e))
|
||||||
yield b'500 Internal Server Error'
|
yield b'502 Bad Gateway'
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
start_response('500 Internal Server Error', ())
|
start_response('500 Internal Server Error', ())
|
||||||
|
yield b'500 Internal Server Error'
|
||||||
raise
|
raise
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user