From f998873fc5669a547901f2733c9c785d744d27ca Mon Sep 17 00:00:00 2001 From: Alex Zoitos Date: Mon, 14 Dec 2020 21:11:48 -0500 Subject: [PATCH] fix(services): improve logging for when Radarr movie already exists (#285) re #260 --- server/api/radarr.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/server/api/radarr.ts b/server/api/radarr.ts index fe22e72c9..4797ef5d7 100644 --- a/server/api/radarr.ts +++ b/server/api/radarr.ts @@ -76,11 +76,9 @@ class RadarrAPI { } }; - public addMovie = async ( - options: RadarrMovieOptions - ): Promise => { + public addMovie = async (options: RadarrMovieOptions): Promise => { try { - const response = await this.axios.post(`/movie`, { + await this.axios.post(`/movie`, { title: options.title, qualityProfileId: options.qualityProfileId, profileId: options.profileId, @@ -94,15 +92,15 @@ class RadarrAPI { searchForMovie: options.searchNow, }, }); - - return response.data; } catch (e) { - logger.error('Something went wrong adding a movie to Radarr', { - label: 'Radarr', - message: e.message, - options, - }); - throw new Error(`[Radarr] Failed to add movie: ${e.message}`); + logger.error( + 'Failed to add movie to Radarr. This might happen if the movie already exists, in which case you can safely ignore this error.', + { + label: 'Radarr', + errorMessage: e.message, + options, + } + ); } };