alibaba / alibaba/Sentinel

[BUG] DefaultBlockExceptionHandler treats all BlockException as FlowException

Open
#3,443 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *bug report*

### Describe what happened
The DefaultBlockExceptionHandler treat all BlockException as FlowException, even if it is a DegradeException. This is not good.

### Describe what you expected to happen
It will set appropriate http status code and message accroding to the type of BlockException.

### How to reproduce it (as minimally and precisely as possible)

1. try to create a degrade exception
2. it will get 429(too many request) and ”Blocked by Sentinel (flow limiting)"
3.

### Tell us your environment

### Anything else we need to know?

Contributor guide

Open the contributing guide

Research direction

Start by locating DefaultBlockExceptionHandler and tracing how it converts BlockException into an HTTP response. Reproduce a DegradeException using the issue's steps, then verify that each BlockException subtype receives an appropriate HTTP status code and message rather than the flow-limiting response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.