alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.44k stars 8.03k forks source link

Fix 3443 to set appropriate httpstatus codes and messages for different types of BlockException #3444

Open Linzyoo opened 3 months ago

Linzyoo commented 3 months ago

Describe what this PR does / why we need it

This PR is to update DefaultExceptionHandler with appropriate httpstatus code and message for different types of BlockException.

Does this pull request fix one issue?

Fixes #3443

Describe how you did it

Create an enum for all BlockException and set appropriate httpstatus code and message.

Describe how to verify it

Add test cases for DefaultExceptionHandler

Special notes for reviews