mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	conf: rename ConfigValidationError -> ConfigurationError & inherit from RuntimeError
This commit is contained in:
		
							parent
							
								
									76b58c4432
								
							
						
					
					
						commit
						8386edc6d5
					
				
							
								
								
									
										6
									
								
								conf.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								conf.py
									
									
									
									
									
								
							@ -17,7 +17,7 @@ from collections import defaultdict
 | 
			
		||||
 | 
			
		||||
from . import world
 | 
			
		||||
 | 
			
		||||
class ConfigValidationError(Exception):
 | 
			
		||||
class ConfigurationError(RuntimeError):
 | 
			
		||||
    """Error when config conditions aren't met."""
 | 
			
		||||
 | 
			
		||||
conf = {'bot':
 | 
			
		||||
@ -50,9 +50,9 @@ conf['pylink'] = conf['bot']
 | 
			
		||||
confname = 'unconfigured'
 | 
			
		||||
 | 
			
		||||
def validate(condition, errmsg):
 | 
			
		||||
    """Raises ConfigValidationError with errmsg unless the given condition is met."""
 | 
			
		||||
    """Raises ConfigurationError with errmsg unless the given condition is met."""
 | 
			
		||||
    if not condition:
 | 
			
		||||
        raise ConfigValidationError(errmsg)
 | 
			
		||||
        raise ConfigurationError(errmsg)
 | 
			
		||||
 | 
			
		||||
def _log(level, text, *args, logger=None, **kwargs):
 | 
			
		||||
    if logger:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user