Skip to content

Commit 36e8ce3

Browse files
committed
Added returning error code
1 parent b3a3fd9 commit 36e8ce3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ async def handle_connection(self, reader, writer):
323323
]
324324
)
325325
except Exception as e:
326+
try:
327+
writer.write(b"HTTP/1.1 500 Internal Server Error\r\n\r\n")
328+
await writer.drain()
329+
except Exception:
330+
pass
326331
self.logger.error(traceback.format_exc())
327332
if self.verbose:
328333
self.print(f"\033[93m[NON-CRITICAL]:\033[97m {e}\033[0m")

0 commit comments

Comments
 (0)