Skip to content

Commit a6f63c4

Browse files
authored
Merge pull request #19 from j4ys0n/request-limit
dont parse error data, log error and body
2 parents 9ab9b8a + a8937e2 commit a6f63c4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
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.4",
3+
"version": "1.4.5",
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +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-
res.status(error.response.status).json(error.response.data)
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)
122124
} else {
123125
res.status(500).json({ error: 'Internal Server Error' })
124126
}

0 commit comments

Comments
 (0)