yiguolei commented on code in PR #11704: URL: https://github.com/apache/doris/pull/11704#discussion_r944041845
########## be/src/common/status.h: ########## @@ -291,125 +279,125 @@ class Status { } template <typename... Args> - static Status PublishTimeout(const std::string& fmt, Args&&... args) { + static Status PublishTimeout(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::PUBLISH_TIMEOUT, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status MemoryAllocFailed(const std::string& fmt, Args&&... args) { + static Status MemoryAllocFailed(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::MEM_ALLOC_FAILED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status BufferAllocFailed(const std::string& fmt, Args&&... args) { + static Status BufferAllocFailed(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::BUFFER_ALLOCATION_FAILED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status InvalidArgument(const std::string& fmt, Args&&... args) { + static Status InvalidArgument(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::INVALID_ARGUMENT, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status MinimumReservationUnavailable(const std::string& fmt, Args&&... args) { + static Status MinimumReservationUnavailable(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::MINIMUM_RESERVATION_UNAVAILABLE, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status Corruption(const std::string& fmt, Args&&... args) { + static Status Corruption(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::CORRUPTION, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status IOError(const std::string& fmt, Args&&... args) { + static Status IOError(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::IO_ERROR, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status NotFound(const std::string& fmt, Args&&... args) { + static Status NotFound(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::NOT_FOUND, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status AlreadyExist(const std::string& fmt, Args&&... args) { + static Status AlreadyExist(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::ALREADY_EXIST, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status NotSupported(const std::string& fmt, Args&&... args) { + static Status NotSupported(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::NOT_IMPLEMENTED_ERROR, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status EndOfFile(const std::string& fmt, Args&&... args) { + static Status EndOfFile(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::END_OF_FILE, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status InternalError(const std::string& fmt, Args&&... args) { + static Status InternalError(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::INTERNAL_ERROR, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status RuntimeError(const std::string& fmt, Args&&... args) { + static Status RuntimeError(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::RUNTIME_ERROR, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status Cancelled(const std::string& fmt, Args&&... args) { + static Status Cancelled(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::CANCELLED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status MemoryLimitExceeded(const std::string& fmt, Args&&... args) { + static Status MemoryLimitExceeded(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::MEM_LIMIT_EXCEEDED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status ThriftRpcError(const std::string& fmt, Args&&... args) { + static Status RpcError(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::THRIFT_RPC_ERROR, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status TimedOut(const std::string& fmt, Args&&... args) { + static Status TimedOut(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::TIMEOUT, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status TooManyTasks(const std::string& fmt, Args&&... args) { + static Status TooManyTasks(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::TOO_MANY_TASKS, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status ServiceUnavailable(const std::string& fmt, Args&&... args) { + static Status ServiceUnavailable(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::SERVICE_UNAVAILABLE, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status Uninitialized(const std::string& fmt, Args&&... args) { + static Status Uninitialized(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::UNINITIALIZED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status Aborted(const std::string& fmt, Args&&... args) { + static Status Aborted(std::string_view fmt, Args&&... args) { return ErrorFmt(TStatusCode::ABORTED, fmt, std::forward<Args>(args)...); } template <typename... Args> - static Status DataQualityError(const std::string& fmt, Args&&... args) { + static Status DataQualityError(std::string_view fmt, Args&&... args) { Review Comment: I find only OLAPInternalError has error stack, static Status DataQualityError(std::string_view fmt, Args&&... args) these method does not generate error stack. -- 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