def __init__(self, code, message, **kwargs):
        cmd_err = kwargs.get('command_error')
        if int(code) in [1000, 1002, 1004]:
            msg_fmt = 'Error [{}]: {} [{}]'.format(code, message, cmd_err)
        else:
            msg_fmt = 'Error [{}]: {}'.format(code, message)

        super(CommandError, self).__init__(msg_fmt)
        self.error_code = code
        self.error_text = message
        self.command_error = cmd_err
        self.commands = kwargs.get('commands')
        self.output = kwargs.get('output')
        self.message = msg_fmt
dataset/ETHPy150Open arista-eosplus/pyeapi/pyeapi/eapilib.py/CommandError.__init__/original