Skip to content

Commit

Permalink
fix: api exception call not throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
leafmoes committed Nov 6, 2024
1 parent 5fc7169 commit 97c2be0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const logger = (res, req) => {

const router = AutoRouter({
before: [withBenchmarking, preflight, withAuth],
missing: () => error(404, '404 not found.'),
missing: () => error(404, '404 Not Found. Please check whether the calling URL is correct.'),
finally: [corsify, logger],
})

Expand All @@ -90,7 +90,7 @@ async function handleCompletion(request) {
const content = messagesPrepare(messages)
return createCompletion(model, content, returnStream)
} catch (err) {
error(500, err.message)
return error(500, err.message)
}
}

Expand Down
9 changes: 5 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
plan: free
envVars:
- key: PORT
value: '8787'
value: 8787
- key: API_PREFIX
value: '/'
- key: API_KEY
Expand Down

0 comments on commit 97c2be0

Please sign in to comment.