From 500b75eaf65578658c638176fd7d11cfe4534be1 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 3 Nov 2019 15:04:14 +0100 Subject: [PATCH] We know there could be a 401 response so we handle it --- seasoned_api/src/tmdb/tmdb.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/seasoned_api/src/tmdb/tmdb.js b/seasoned_api/src/tmdb/tmdb.js index 4d95e96..ab8c847 100644 --- a/seasoned_api/src/tmdb/tmdb.js +++ b/seasoned_api/src/tmdb/tmdb.js @@ -116,6 +116,11 @@ class TMDB { status: 404, message: error.response.body.status_message } + } else if (error.status === 401) { + throw { + status: 401, + message: error.response.body.status_message + } } throw {