def __str__(self):
    if self.message:
        return self.message
    if (self.type == self.UNKNOWN_METHOD):
        return 'Unknown method'
    elif (self.type == self.INVALID_MESSAGE_TYPE):
        return 'Invalid message type'
    elif (self.type == self.WRONG_METHOD_NAME):
        return 'Wrong method name'
    elif (self.type == self.BAD_SEQUENCE_ID):
        return 'Bad sequence ID'
    elif (self.type == self.MISSING_RESULT):
        return 'Missing result'
    else:
        return 'Default (unknown) TApplicationException'
def __str__(self):
    if self.message:
        return self.message
    if (self.type == self.UNKNOWN_METHOD):
        return 'Unknown method'
    elif (self.type == self.INVALID_MESSAGE_TYPE):
        return 'Invalid message type'
    elif (self.type == self.WRONG_METHOD_NAME):
        return 'Wrong method name'
    elif (self.type == self.BAD_SEQUENCE_ID):
        return 'Bad sequence ID'
    elif (self.type == self.MISSING_RESULT):
        return 'Missing result'
    else:
        return 'Default (unknown) TApplicationException'