File size: 555 Bytes
b97f6e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from typing import *

class FauxPilotException(Exception):
    def __init__(self, message: str, type: Optional[str] = None, param: Optional[str] = None, code: Optional[int] = None):
        super().__init__(message)
        self.message = message
        self.type = type
        self.param = param
        self.code = code

    def json(self):
        return {
            'error': {
                'message': self.message,
                'type': self.type,
                'param': self.param,
                'code': self.code
            }
        }