Ignore parsed MessageContent of unknown type.

This commit is contained in:
levlam 2023-07-03 15:46:31 +03:00
parent 4dc1bd4988
commit b04eeb4d87
4 changed files with 3 additions and 6 deletions

View File

@ -1870,7 +1870,7 @@ static void parse(unique_ptr<MessageContent> &content, ParserT &parser) {
break;
}
default:
LOG(FATAL) << "Have unknown message content type " << static_cast<int32>(content_type);
is_bad = true;
}
if (is_bad) {
LOG(ERROR) << "Load a message with an invalid content of type " << content_type;

View File

@ -127,8 +127,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, MessageContentType cont
case MessageContentType::Story:
return string_builder << "Story";
default:
UNREACHABLE();
return string_builder;
return string_builder << "Invalid type " << static_cast<int32>(content_type);
}
}

View File

@ -150,7 +150,6 @@ static void parse(unique_ptr<StoryContent> &content, ParserT &parser) {
break;
}
default:
LOG(ERROR) << "Have unknown story content type " << static_cast<int32>(content_type);
is_bad = true;
}
if (is_bad) {

View File

@ -17,8 +17,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, StoryContentType conten
case StoryContentType::Unsupported:
return string_builder << "Unsupported";
default:
UNREACHABLE();
return string_builder;
return string_builder << "Invalid type " << static_cast<int32>(content_type);
}
}