mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-06-09 06:41:19 +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()
|