Skip to content

Commit

Permalink
Merge pull request #19 from j4ys0n/request-limit
Browse files Browse the repository at this point in the history
dont parse error data, log error and body
  • Loading branch information
j4ys0n authored Sep 25, 2024
2 parents 9ab9b8a + a8937e2 commit a6f63c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llm-proxy",
"version": "1.4.4",
"version": "1.4.5",
"description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens",
"main": "dist/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export class LLMController {
} catch (error) {
log(`Error forwarding request: ${(error as any).toString()}`, 'error')
if (axios.isAxiosError(error) && error.response) {
res.status(error.response.status).json(error.response.data)
log(`Error response from ${fullUrl}:`, 'error', error.response.data)
log(`Request body was:`, 'error', req.body)
res.status(error.response.status).send(error.response.data)
} else {
res.status(500).json({ error: 'Internal Server Error' })
}
Expand Down

0 comments on commit a6f63c4

Please sign in to comment.