[WIKI-565] chore: handle 404 messages in live server (#7472)

* chore: handle 404 messages in live server

* chore: removed error stack from response
This commit is contained in:
sriram veeraghanta 2025-07-24 15:13:44 +05:30 committed by GitHub
parent 2746bad86b
commit 849b7b7bf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -1,3 +1,4 @@
PORT=3100
API_BASE_URL="http://localhost:8000" API_BASE_URL="http://localhost:8000"
WEB_BASE_URL="http://localhost:3000" WEB_BASE_URL="http://localhost:3000"

View file

@ -82,14 +82,16 @@ export class Server {
}); });
} catch (error) { } catch (error) {
manualLogger.error("Error in /convert-document endpoint:", error); manualLogger.error("Error in /convert-document endpoint:", error);
res.status(500).send({ res.status(500).json({
message: `Internal server error. ${error}`, message: `Internal server error.`,
}); });
} }
}); });
this.app.use((_req: Request, res: Response) => { this.app.use((_req: Request, res: Response) => {
res.status(404).send("Not Found"); res.status(404).json({
message: "Not Found",
});
}); });
} }