From 5ca3bb8f8de3351b47dedc39ff06e419eee6715c Mon Sep 17 00:00:00 2001 From: Deborah D Date: Thu, 10 Oct 2024 20:27:50 +0000 Subject: [PATCH] Send data when error occurs to display user error message --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 7fde290..0be573c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -225,6 +225,7 @@ const server = createServer(async (request, response) => { } catch (err) { console.error(err); response.statusCode = 500 + response.write("data: Something went wrong\n\n") response.end() } });