fix(services): improve logging for when Radarr movie already exists (#285)

re #260
pull/304/head
Alex Zoitos 4 years ago committed by GitHub
parent 33b54c08b5
commit f998873fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,11 +76,9 @@ class RadarrAPI {
}
};
public addMovie = async (
options: RadarrMovieOptions
): Promise<RadarrMovie> => {
public addMovie = async (options: RadarrMovieOptions): Promise<void> => {
try {
const response = await this.axios.post<RadarrMovie>(`/movie`, {
await this.axios.post<RadarrMovie>(`/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', {
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',
message: e.message,
errorMessage: e.message,
options,
});
throw new Error(`[Radarr] Failed to add movie: ${e.message}`);
}
);
}
};

Loading…
Cancel
Save