diff options
author | James Taylor <user234683@users.noreply.github.com> | 2018-07-02 19:41:02 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2018-07-02 19:41:02 -0700 |
commit | 49f10cb89ac458270a2ff5a48b2211e5d2c159ab (patch) | |
tree | d786dc5f405edd612d25624444f2ce4b58188ef9 /server.py | |
parent | 6864ec843cce6286d5f1b2133c96487ac32d0d91 (diff) | |
download | yt-local-49f10cb89ac458270a2ff5a48b2211e5d2c159ab.tar.lz yt-local-49f10cb89ac458270a2ff5a48b2211e5d2c159ab.tar.xz yt-local-49f10cb89ac458270a2ff5a48b2211e5d2c159ab.zip |
502 Bad Gateway instead of just 500 error
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -113,14 +113,15 @@ def site_dispatch(env, start_response): yield error_code('404 Not Found', start_response) return - - except (socket.error, ConnectionAbortedError) as e: - start_response('500 Internal Server Error', ()) + + except socket.error as e: + start_response('502 Bad Gateway', ()) print(str(e)) - yield b'500 Internal Server Error' + yield b'502 Bad Gateway' except Exception: start_response('500 Internal Server Error', ()) + yield b'500 Internal Server Error' raise return |