def from_code(cls, code, **kw):
        """Construct a ``TChannelError`` instance from an error code.

        This will return the appropriate class type for the given code.
        """
        return {
            TIMEOUT: TimeoutError,
            CANCELED: CanceledError,
            BUSY: BusyError,
            DECLINED: DeclinedError,
            UNEXPECTED_ERROR: UnexpectedError,
            BAD_REQUEST: BadRequestError,
            NETWORK_ERROR: NetworkError,
            UNHEALTHY: UnhealthyError,
            FATAL: FatalProtocolError,
        }[code](**kw)
def from_code ( cls , code , ** kw ) : return { TIMEOUT : TimeoutError , CANCELED : CanceledError , BUSY : BusyError , DECLINED : DeclinedError , UNEXPECTED_ERROR : UnexpectedError , BAD_REQUEST : BadRequestError , NETWORK_ERROR : NetworkError , UNHEALTHY : UnhealthyError , FATAL : FatalProtocolError , } [ code ] ( ** kw )
Construct a ``TChannelError`` instance from an error code.

        This will return the appropriate class type for the given code.