def __init__(self, api_key, env_name, request, api_url=_API_URL,
                 timeout=30, env_variables=_DEFAULT_ENV_VARIABLES,
                 meta_variables=_DEFAULT_META_VARIABLES, session=None,
                 root_path=None):
        logging.Handler.__init__(self)
        self.api_key = api_key
        self.api_url = api_url
        self.env_name = env_name
        self.env_variables = env_variables
        self.meta_variables = meta_variables
        self.timeout = timeout
        self.session = session
        self.root_path = root_path

        if self.root_path is None:
            self.root_path = os.path.dirname(os.path.abspath(__file__))

        # handle Flask request object:
        self.request = {
            'url': request.url,
            'path': request.path,
            'method': request.method,
            'values': request.values,
            'body': request.data,
            'headers': request.headers,
            'remote_addr': request.remote_addr
        }

        try:
            self.request['json'] = request.json
        except __HOLE__:
            pass # Werkzeug couldn't parse json, ignored
dataset/ETHPy150Open kienpham2000/airbrake-flask/airbrake/airbrake.py/AirbrakeErrorHandler.__init__