Skip to content

Commit

Permalink
fix(instance): auto start error 404 instead of 500 (#335)
Browse files Browse the repository at this point in the history
* fix(instance): auto start error 404 instead 500

* fix

* better

* fix
  • Loading branch information
samuelmasse committed Feb 2, 2022
1 parent c10e228 commit 4671560
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/channels/src/base/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export class ChannelApiManager {
this.asyncMiddleware(async (req, res, next) => {
const nreq = req as ChannelApiRequest
nreq.scope = req.params.scope
await this.service.require(nreq.scope)

try {
await this.service.require(nreq.scope)
} catch {
return res.sendStatus(404)
}

await fn(nreq, res, next)
})
)
Expand Down

0 comments on commit 4671560

Please sign in to comment.