]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/middlewares/video-channels.ts
refactor API errors to standard error format
[github/Chocobozzz/PeerTube.git] / server / helpers / middlewares / video-channels.ts
index e6eab65a28a0d43238bdc6b7ee9ccca2e6e82082..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
   }