github-actions[bot] commented on code in PR #63730:
URL: https://github.com/apache/doris/pull/63730#discussion_r3309509844


##########
be/src/common/check.cpp:
##########
@@ -0,0 +1,29 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "common/check.h"
+
+#include "common/exception.h"
+#include "common/status.h"
+
+namespace doris {
+
+void doris_check_fail(std::string_view message) {

Review Comment:
   `message` is already the fully-rendered stream contents, but 
`Status::FatalError(message)` treats it as a fmt format string in debug builds 
(`FatalError` calls `fmt::format(msg, ...)` under `#ifndef NDEBUG`). A check 
like `DORIS_CHECK(false) << "json {";` will throw `fmt::format_error` before 
the fatal check path/logging, while release builds preserve the literal text. 
Please pass it as data, e.g. `Status::FatalError("{}", message)`, so streamed 
braces and other fmt syntax remain literal.
   
   ```suggestion
       throw Exception(Status::FatalError("{}", message));
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to