<commit_before>package com.google.research.bleth.servlets;

import com.google.research.bleth.utils.Queries;

import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** A servlet used for deleting simulations. */
@WebServlet("/delete-simulation")
public class DeleteSimulationServlet extends HttpServlet {

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String simulationId = request.getParameter("simulationId");
        Queries.delete(simulationId);
        response.setContentType("text/html;");
        response.getWriter().println("Simulation has been deleted successfully.");
    }
}
<commit_msg>add exceptions handling.<commit_after>package com.google.research.bleth.servlets;

import com.google.research.bleth.utils.Queries;

import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** A servlet used for deleting simulations. */
@WebServlet("/delete-simulation")
public class DeleteSimulationServlet extends HttpServlet {

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String simulationId = request.getParameter("simulationId");
        String responseText = "Simulation has been deleted successfully.";
        try {
            Queries.delete(simulationId);
        } catch (Exception e) {
            responseText = "Something went wrong: " + e.getMessage();
        }
        response.setContentType("text/html;");
        response.getWriter().println(responseText);
    }
}

{'fraction_non_alphanumeric': 0.09994568169473113, 'fraction_numerical': 0.0, 'mean_word_length': 4.370262390670554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7490379', 'n_tokens_mistral': 467, 'n_tokens_neox': 467, 'n_words': 104}