diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 3b5cdde77..09165bb71 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -1870,7 +1870,7 @@ static void parse(unique_ptr &content, ParserT &parser) { break; } default: - LOG(FATAL) << "Have unknown message content type " << static_cast(content_type); + is_bad = true; } if (is_bad) { LOG(ERROR) << "Load a message with an invalid content of type " << content_type; diff --git a/td/telegram/MessageContentType.cpp b/td/telegram/MessageContentType.cpp index 091835cb0..28e1903fc 100644 --- a/td/telegram/MessageContentType.cpp +++ b/td/telegram/MessageContentType.cpp @@ -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(content_type); } } diff --git a/td/telegram/StoryContent.cpp b/td/telegram/StoryContent.cpp index 3550605c3..6f1e6145c 100644 --- a/td/telegram/StoryContent.cpp +++ b/td/telegram/StoryContent.cpp @@ -150,7 +150,6 @@ static void parse(unique_ptr &content, ParserT &parser) { break; } default: - LOG(ERROR) << "Have unknown story content type " << static_cast(content_type); is_bad = true; } if (is_bad) { diff --git a/td/telegram/StoryContentType.cpp b/td/telegram/StoryContentType.cpp index 40bfa7737..f467c2663 100644 --- a/td/telegram/StoryContentType.cpp +++ b/td/telegram/StoryContentType.cpp @@ -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(content_type); } }