]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/middlewares/video-channels.ts
Refactor server errors handler
[github/Chocobozzz/PeerTube.git] / server / helpers / middlewares / video-channels.ts
index 602555921122a58bb01a7032fd4969f144dd38e5..f5ed5ef0f2b9dc0fcbb251ebbcaf29b9ae22d551 100644 (file)
@@ -31,9 +31,10 @@ export {
 
 function processVideoChannelExist (videoChannel: MChannelBannerAccountDefault, res: express.Response) {
   if (!videoChannel) {
-    res.status(HttpStatusCode.NOT_FOUND_404)
-      .json({ error: 'Video channel not found' })
-
+    res.fail({
+      status: HttpStatusCode.NOT_FOUND_404,
+      message: 'Video channel not found'
+    })
     return false
   }