def write_error(self, status_code, **kwargs):
        exc_info = kwargs.get('exc_info')
        message = ''
        status_message = responses.get(status_code, 'Unknown Error')
        if exc_info:
            exception = exc_info[1]
            # get the custom message, if defined
            try:
                message = exception.log_message % exception.args
            except Exception:
                pass

            # construct the custom reason, if defined
            reason = getattr(exception, 'reason', '')
            if reason:
                status_message = reason
        self.set_header('Content-Type', 'application/json')
        self.write(json.dumps({
            'status': status_code,
            'message': message or status_message,
        }))
Generator for the sequence.
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/apihandlers/base.py/APIHandler.write_error--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/series/sequences.py/SeqExprOp.gen