zclllyybb commented on code in PR #42344: URL: https://github.com/apache/doris/pull/42344#discussion_r1868815212
########## be/src/vec/common/assert_cast.h: ########## @@ -45,33 +45,33 @@ PURE To assert_cast(From&& from) { if (auto ptr = dynamic_cast<To>(from); ptr != nullptr) { return ptr; } - LOG(FATAL) << fmt::format("Bad cast from type:{}* to {}", - demangle(typeid(*from).name()), - demangle(typeid(To).name())); + throw doris::Exception(doris::Status::FatalError("Bad cast from type:{}* to {}", + demangle(typeid(*from).name()), + demangle(typeid(To).name()))); } } else { if (typeid(from) == typeid(To)) { return static_cast<To>(from); } } - LOG(FATAL) << fmt::format("Bad cast from type:{} to {}", demangle(typeid(from).name()), - demangle(typeid(To).name())); - __builtin_unreachable(); + throw doris::Exception(doris::Status::FatalError("Bad cast from type:{} to {}", + demangle(typeid(from).name()), + demangle(typeid(To).name()))); }; #ifndef NDEBUG try { return perform_cast(std::forward<From>(from)); } catch (const std::exception& e) { - LOG(FATAL) << "assert cast err:" << e.what(); + throw doris::Exception(doris::Status::FatalError("assert cast err:{}", e.what())); } __builtin_unreachable(); Review Comment: remove these two `__builtin_unreachable`, include L76 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org