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


##########
be/src/http/action/download_action.cpp:
##########
@@ -61,15 +61,30 @@ void DownloadAction::handle_normal(HttpRequest* req, const 
std::string& file_par
     if (config::enable_token_check) {
         status = check_token(req);
         if (!status.ok()) {
-            HttpChannel::send_reply(req, status.to_string());
-            return;
+            std::string error_msg = status.get_error_msg();

Review Comment:
   warning: no member named 'get_error_msg' in 'doris::Status' 
[clang-diagnostic-error]
   ```cpp
               std::string error_msg = status.get_error_msg();
                                              ^
   ```
   



##########
be/src/http/action/download_action.cpp:
##########
@@ -61,15 +61,30 @@
     if (config::enable_token_check) {
         status = check_token(req);
         if (!status.ok()) {
-            HttpChannel::send_reply(req, status.to_string());
-            return;
+            std::string error_msg = status.get_error_msg();
+            if (status.is_not_authorized()) {
+                HttpChannel::send_reply(req, HttpStatus::UNAUTHORIZED, 
error_msg);
+                return;
+            } else {
+                HttpChannel::send_reply(req, 
HttpStatus::INTERNAL_SERVER_ERROR, error_msg);
+                return;
+            }
         }
     }
 
     status = check_path_is_allowed(file_param);
     if (!status.ok()) {
-        HttpChannel::send_reply(req, status.to_string());
-        return;
+        std::string error_msg = status.get_error_msg();

Review Comment:
   warning: no member named 'get_error_msg' in 'doris::Status' 
[clang-diagnostic-error]
   ```cpp
           std::string error_msg = status.get_error_msg();
                                          ^
   ```
   



##########
be/src/http/action/download_action.cpp:
##########
@@ -91,16 +106,30 @@
 
     Status status = check_log_path_is_allowed(absolute_path);
     if (!status.ok()) {
-        std::string error_msg = status.to_string();
-        HttpChannel::send_reply(req, error_msg);
-        return;
+        std::string error_msg = status.get_error_msg();

Review Comment:
   warning: no member named 'get_error_msg' in 'doris::Status' 
[clang-diagnostic-error]
   ```cpp
           std::string error_msg = status.get_error_msg();
                                          ^
   ```
   



##########
be/src/http/action/download_action.cpp:
##########
@@ -91,16 +106,30 @@
 
     Status status = check_log_path_is_allowed(absolute_path);
     if (!status.ok()) {
-        std::string error_msg = status.to_string();
-        HttpChannel::send_reply(req, error_msg);
-        return;
+        std::string error_msg = status.get_error_msg();
+        if (status.is_not_authorized()) {
+            HttpChannel::send_reply(req, HttpStatus::UNAUTHORIZED, error_msg);
+            return;
+        } else {
+            HttpChannel::send_reply(req, HttpStatus::INTERNAL_SERVER_ERROR, 
error_msg);
+            return;
+        }
     }
 
     bool is_dir = false;
     status = io::global_local_filesystem()->is_directory(absolute_path, 
&is_dir);
     if (!status.ok()) {
-        HttpChannel::send_reply(req, status.to_string());
-        return;
+        std::string error_msg = status.get_error_msg();

Review Comment:
   warning: no member named 'get_error_msg' in 'doris::Status' 
[clang-diagnostic-error]
   ```cpp
           std::string error_msg = status.get_error_msg();
                                          ^
   ```
   



-- 
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