Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont crash on error #20

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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