<commit_before>package org.papathanasiou.denis.ARMS

import javax.ws.rs.*
import javax.ws.rs.core.MediaType.APPLICATION_JSON

@Path("")
class RESTfulEndpoints {
    @GET @Produces(APPLICATION_JSON)
    @Path("{database}/{collection}")
    fun findDocument(@PathParam("database") database: String,
                     @PathParam("collection") collection: String): String? {
        // simple reply for now
        return "{'db': '$database', 'coll': '$collection'}"
    }
}<commit_msg>Added custom exception for responding to invalid api requests as 'Bad Request' (400)<commit_after>package org.papathanasiou.denis.ARMS

import javax.ws.rs.*
import javax.ws.rs.core.MediaType.APPLICATION_JSON
import javax.ws.rs.core.Response

class BadAPIRequest : WebApplicationException {
    constructor(message: String?) : super(message, Response.Status.BAD_REQUEST)
}

@Path("")
class RESTfulEndpoints {
    @GET @Produces(APPLICATION_JSON)
    @Path("{database}/{collection}")
    fun findDocument(@PathParam("database") database: String,
                     @PathParam("collection") collection: String): String? {
        // simple reply for now
        return "{'db': '$database', 'coll': '$collection'}"
    }
}
{'fraction_non_alphanumeric': 0.14024896265560166, 'fraction_numerical': 0.0024896265560165973, 'mean_word_length': 4.004149377593361, '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': '6439612', 'n_tokens_mistral': 360, 'n_tokens_neox': 351, 'n_words': 79}