From 63b5139e939bbb7c4054f9b8e3ad5b737a0214fe Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 6 Jun 2023 22:11:38 +0200 Subject: [PATCH] Split error message for better logging --- Tranga/TaskManager.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index c80d14f..57473dd 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -190,8 +190,14 @@ public class TaskManager newTask = new UpdateLibrariesTask(taskType, reoccurrenceTime); break; case TrangaTask.Task.DownloadNewChapters: - if(connectorName is null || internalId is null || language is null) - logger?.WriteLine(this.GetType().ToString(), $"Values connectorName, publicationName and language can not be null."); + if (connectorName is null) + logger?.WriteLine(this.GetType().ToString(), $"Value connectorName can not be null."); + if(internalId is null) + logger?.WriteLine(this.GetType().ToString(), $"Value internalId can not be null."); + if(language is null) + logger?.WriteLine(this.GetType().ToString(), $"Value language can not be null."); + if (connectorName is null || internalId is null || language is null) + return null; GetConnector(connectorName); //Check if connectorName is valid Publication publication = GetAllPublications().First(pub => pub.internalId == internalId); newTask = new DownloadNewChaptersTask(taskType, connectorName!, publication, reoccurrenceTime, language!);