Skip to content

Commit

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

0 comments on commit a65ece6

Please sign in to comment.