add FoxchatError type
This commit is contained in:
		
							parent
							
								
									f6629fbb33
								
							
						
					
					
						commit
						d34c41a126
					
				
					 7 changed files with 42 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue