Added additional dns error handling

This commit is contained in:
Marcel Baumgartner
2023-07-20 02:00:03 +02:00
parent daba4cba04
commit daeb4dd5b9

View File

@@ -183,6 +183,8 @@ public class DomainService
if (!ConfigService.Get().Moonlight.Domains.Enable) if (!ConfigService.Get().Moonlight.Domains.Enable)
throw new DisplayException("This operation is disabled"); throw new DisplayException("This operation is disabled");
try
{
var domain = EnsureData(d); var domain = EnsureData(d);
var rname = $"{domain.Name}.{domain.SharedDomain.Name}"; var rname = $"{domain.Name}.{domain.SharedDomain.Name}";
@@ -236,6 +238,15 @@ public class DomainService
Name = name Name = name
})); }));
} }
}
catch (OverflowException)
{
throw new DisplayException("Invalid dns record values");
}
catch (FormatException)
{
throw new DisplayException("Invalid dns record values");
}
//TODO: AuditLog //TODO: AuditLog
} }