Skip to content

Commit fa5ce24

Browse files
committed
dont crash on error
1 parent a8937e2 commit fa5ce24

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "llm-proxy",
3-
"version": "1.4.5",
3+
"version": "1.4.6",
44
"description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens",
55
"main": "dist/index.js",
66
"scripts": {

src/controllers/llm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ export class LLMController {
118118
} catch (error) {
119119
log(`Error forwarding request: ${(error as any).toString()}`, 'error')
120120
if (axios.isAxiosError(error) && error.response) {
121-
log(`Error response from ${fullUrl}:`, 'error', error.response.data)
122-
log(`Request body was:`, 'error', req.body)
123-
res.status(error.response.status).send(error.response.data)
121+
// log(`Error response from ${fullUrl}:`, 'error', error.response.data)
122+
log(`Request body caused error:`, 'error', req.body)
123+
res.status(error.response.status).json({ error: 'Error processing request' })
124124
} else {
125125
res.status(500).json({ error: 'Internal Server Error' })
126126
}

0 commit comments

Comments
 (0)