def handle_error_response(self, msg, response):
        words = response.split()
        error_code = ''
        if len(words) > 1:
            error_code = words[1]

        config_error = {
            '52': SMS.ERROR_INVALID_DESTINATION_NUMBER,
            '59': SMS.ERROR_MESSAGE_TOO_LONG,
        }.get(error_code)

        if config_error:
            msg.set_system_error(config_error)
            return

        raise SyniverseException(
            "Received error code %s while sending SMS from Syniverse backend "
            "%s, see documentation for details." % (error_code, self.pk)
        )
dataset/ETHPy150Open dimagi/commcare-hq/corehq/messaging/smsbackends/mach/models.py/SQLMachBackend.handle_error_response/original