You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "njhw12 (via GitHub)" <gi...@apache.org> on 2024/08/14 06:37:08 UTC

[I] org.apache.servicecomb.common.rest.AbstractRestInvocation#sendResponse在reasonPhrase存在'\r' '\n'情况不发送响应 [servicecomb-java-chassis]

njhw12 opened a new issue, #4469:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4469

   业务自定义ExceptionToProducerResponseConverter
   1.在转换时直接获取异常的message作为reasonPhase(可能是底层中间件异常,比如mybatis sql异常),可能存在'\r' '\n'
   ![image](https://github.com/user-attachments/assets/1e79e99a-93ca-410d-b178-35ebfb69aa01)
   2.导致在设置响应时触发HttpResponseStatus校验异常
   ![image](https://github.com/user-attachments/assets/92edfc66-0993-4ce4-ae68-2efc9dccaee6)
   ![image](https://github.com/user-attachments/assets/f9a5b545-de96-4763-b340-bf02bd4bfe42)
   3.无法触发响应,客户端一直waiting到超时时间
   ![image](https://github.com/user-attachments/assets/65455909-4e4e-440f-beaf-d304ff80cfa7)
   
   
   


-- 
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-unsubscribe@servicecomb.apache.org.apache.org

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


Re: [I] org.apache.servicecomb.common.rest.AbstractRestInvocation#sendResponse在reasonPhrase存在'\r' '\n'情况不发送响应 [servicecomb-java-chassis]

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #4469:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4469#issuecomment-2287974189

   业务扩展实现的时候, reason phase 不要使用 exception message, 改下扩展代码即可。 如果使用exception message, 使用 
   
   `public InvocationException(int statusCode, String reasonPhrase, Object errorData, Throwable cause)` 等构造函数。 errorData 建议使用 `CommonExceptionData` , 例子: 
   
   ```
   CommonExceptionData data = new CommonExceptionData(errorMsg);
   InvocationException ie = new InvocationException(statusCode, reasonPhrase, data, e);
   ```
   


-- 
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-unsubscribe@servicecomb.apache.org

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


Re: [I] org.apache.servicecomb.common.rest.AbstractRestInvocation#sendResponse在reasonPhrase存在'\r' '\n'情况不发送响应 [servicecomb-java-chassis]

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 closed issue #4469: org.apache.servicecomb.common.rest.AbstractRestInvocation#sendResponse在reasonPhrase存在'\r' '\n'情况不发送响应
URL: https://github.com/apache/servicecomb-java-chassis/issues/4469


-- 
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-unsubscribe@servicecomb.apache.org

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