Handle unauthorized kavita

This commit is contained in:
2024-02-28 02:25:17 +01:00
parent bee6e7ba37
commit 72ae124418
2 changed files with 19 additions and 8 deletions

View File

@ -23,6 +23,8 @@ public abstract class LibraryConnector : GlobalBase
Log($"Creating libraryConnector {Enum.GetName(libraryType)}");
if (!baseUrlRex.IsMatch(baseUrl))
throw new ArgumentException("Base url does not match pattern");
if(auth == "")
throw new ArgumentNullException(nameof(auth), "Auth can not be empty");
this.baseUrl = baseUrlRex.Match(baseUrl).Value;
this.auth = auth;
this.libraryType = libraryType;