Skip to content

LUT-27970: Fixed SONAR issue by handling potential Exceptions #431

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@

import org.apache.commons.text.StringEscapeUtils;

import fr.paris.lutece.portal.service.util.AppLogService;
import fr.paris.lutece.portal.service.util.AppPropertiesService;

/**
* Servlet using for BBCODE parsing
*
* @deprecated
*/
@Deprecated
public class ParserBbcodeServlet extends HttpServlet
Expand Down Expand Up @@ -95,15 +98,18 @@ protected void processRequest( HttpServletRequest request, HttpServletResponse r
* servlet request
* @param response
* servlet response
* @throws ServletException
* the servlet Exception
* @throws IOException
* the io exception
*/
@Override
protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws IOException
protected void doGet( HttpServletRequest request, HttpServletResponse response )
{
processRequest( request, response );
try
{
processRequest( request, response );
}
catch( IOException e )
{
AppLogService.error( "Error occurred while making GET request", e );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an AppException must be thrown

}
}

/**
Expand All @@ -113,15 +119,18 @@ protected void doGet( HttpServletRequest request, HttpServletResponse response )
* servlet request
* @param response
* servlet response
* @throws ServletException
* the servlet Exception
* @throws IOException
* the io exception
*/
@Override
protected void doPost( HttpServletRequest request, HttpServletResponse response ) throws IOException
protected void doPost( HttpServletRequest request, HttpServletResponse response )
{
processRequest( request, response );
try
{
processRequest( request, response );
}
catch( IOException e )
{
AppLogService.error( "Error occurred while making POST request", e );
}
}

/**
Expand Down