-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #2138] add the global exception handler, remove the duplicate try catch #2223
base: master
Are you sure you want to change the base?
Conversation
...shboard/src/main/java/com/alibaba/csp/sentinel/dashboard/handler/GlobalExceptionHandler.java
Outdated
Show resolved
Hide resolved
...shboard/src/main/java/com/alibaba/csp/sentinel/dashboard/handler/GlobalExceptionHandler.java
Outdated
Show resolved
Hide resolved
...shboard/src/main/java/com/alibaba/csp/sentinel/dashboard/handler/GlobalExceptionHandler.java
Outdated
Show resolved
Hide resolved
@cdfive I have solved the problems. could you help to review it again when you are free. tks. |
@brotherlu-xcq |
Map<String, String[]> params = webRequest.getParameterMap(); | ||
String contextPath = getRequestPath(webRequest); | ||
logger.error("[HandleExecutionException] Request failed, context path: {}, request params: {}, error: ", | ||
contextPath, buildParamMessage(params), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe e.getCause()
is better here (for ExecutionException)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sczyh30 , I tried this. print the e will also print the cause exception. I think maybe we can keep it as now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Describe what this PR does / why we need it
Fixes #2138
add the global exception handler, remove the duplicate try catch
Does this pull request fix one issue?
Fixes #2138
Describe how you did it
add GlobalExceptionHandler to catch the exception and format the error return.
Describe how to verify it
See the screenshot after change.
Special notes for reviews