add FoxchatError type

This commit is contained in:
sam 2024-05-14 14:50:01 +02:00
parent f6629fbb33
commit d34c41a126
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
7 changed files with 42 additions and 20 deletions

View file

@ -29,7 +29,7 @@ public abstract class IDatabaseContext : DbContext
public async Task<Instance> GetInstanceAsync(CancellationToken ct = default)
{
var instance = await Instance.FirstOrDefaultAsync(ct)
?? throw new Exception("GetInstanceAsync called without Instance being initialized"); // TODO: replace this with specific exception type
?? throw new FoxchatError.DatabaseError("GetInstanceAsync called without Instance being initialized");
return instance;
}