mirror of
				https://github.com/Telecominfraproject/oopt-gnpy.git
				synced 2025-10-31 10:07:57 +00:00 
			
		
		
		
	 71b157a8ba
			
		
	
	71b157a8ba
	
	
	
		
			
			Once the actual config-parsing code start raising these exceptions instead of directly calling sys.exit(), the user experience would deteriorate due to raw exception traces. There's little value in the trace itself, so just wrap the whole config loading with pretty error formatting. We still do not point to a specific place where that error is defined (such as a line/column in a given JSON file) because that information is already lost by the time we perform these checks. Also, these checks are largely open-coded ad-hoc stuff. Some required items are not covered, raising KeyError instead. We should get a formal schema for these...
		
			
				
	
	
		
			14 lines
		
	
	
		
			234 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			234 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| #!/usr/bin/env python3
 | |
| # -*- coding: utf-8 -*-
 | |
| 
 | |
| '''
 | |
| gnpy.core.exceptions
 | |
| ====================
 | |
| 
 | |
| Exceptions thrown by other gnpy modules
 | |
| '''
 | |
| 
 | |
| 
 | |
| class ConfigurationError(Exception):
 | |
|     '''User-provided configuration contains an error'''
 |