You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/07/24 01:32:38 UTC

[GitHub] [skywalking] polaris16 opened a new issue #5165: How to deal with the case where the HTTP response status code returns 200 but an internal error?

polaris16 opened a new issue #5165:
URL: https://github.com/apache/skywalking/issues/5165


   How to deal with the case where the HTTP response status code returns 200 but an internal error?
   
   
   In my project
   
   class ProjectController {
       @Get("/project/${id}")
       public ApiResponse<Project> getProjectById(Long id) {
           ApiResponse response = new ApiResponse();
   
           try {
               //...
               response.setCode(0); // ok
           }catch(Exception ex) {
               response.setCode(-1); // error
               response.setMsg("xxxx");             
           }
   
           // http status code 200
           return response;
       }
   }
   
   
   In this case, skywalking considers a successful request and does not generate an alarm. 
   Is there any solution to this case? Recognition error occurs and alarm is generated。
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #5165: How to deal with the case where the HTTP response status code returns 200 but an internal error?

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #5165:
URL: https://github.com/apache/skywalking/issues/5165


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #5165: How to deal with the case where the HTTP response status code returns 200 but an internal error?

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #5165:
URL: https://github.com/apache/skywalking/issues/5165#issuecomment-663404042


   Simple answer, change the source codes. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org