-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sonar feedback: don't throw generic exceptions in servlets
- Loading branch information
Benjamin Reed
committed
Jul 14, 2023
1 parent
34f4a90
commit c8a180c
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,7 +327,8 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr | |
} | ||
|
||
if (proxy == null) { | ||
throw new IllegalStateException("unable to get event proxy"); | ||
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "unable to get event proxy"); | ||
Check notice Code scanning / SonarCloud Exceptions should not be thrown from servlet methods Low
Handle the following exception that could be thrown by "sendError": IOException. See more on SonarCloud
|
||
return; | ||
} | ||
|
||
EventBuilder bldr = new EventBuilder(EventConstants.DISCOVERYCONFIG_CHANGED_EVENT_UEI, "ActionDiscoveryServlet"); | ||
|