You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			381 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			381 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import json
 | 
						|
import cherrypy as cp 
 | 
						|
 | 
						|
class APIError(cp.HTTPError):
 | 
						|
    def __init__(self, status: int = 500, message: str = ''):
 | 
						|
        super().__init__(status=status)
 | 
						|
        self._error_message = message
 | 
						|
 | 
						|
    def set_response(self):
 | 
						|
        super().set_response()
 | 
						|
        response = cp.serving.response
 | 
						|
        response.body = json.dumps({'error': self._error_message}).encode()
 |