<commit_before>package net.trajano.openidconnect.core;

import java.net.URI;

import javax.ws.rs.BadRequestException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

/**
 * Open ID Connect Exception. This wraps an error response based on the data
 * provided
 * 
 * @author Archimedes
 */
public class OpenIdConnectException extends BadRequestException {

    /**
     * 
     */
    private static final long serialVersionUID = 7363379256768742855L;

    public OpenIdConnectException(ErrorCode error) {

        this(new ErrorResponse(error));
    }

    public OpenIdConnectException(ErrorCode error, String errorDescription) {

        this(new ErrorResponse(error, errorDescription));
    }

    public OpenIdConnectException(ErrorCode error, String errorDescription, URI errorUri) {

        this(new ErrorResponse(error, errorDescription, errorUri));
    }

    public OpenIdConnectException(ErrorResponse errorResponse) {

        super(Response.ok(errorResponse)
                .status(Status.BAD_REQUEST)
                .build());
    }
}<commit_msg>Made it return a JSON<commit_after>package net.trajano.openidconnect.core;

import java.net.URI;

import javax.ws.rs.BadRequestException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

/**
 * Open ID Connect Exception. This wraps an error response based on the data
 * provided
 *
 * @author Archimedes
 */
public class OpenIdConnectException extends BadRequestException {

    /**
     *
     */
    private static final long serialVersionUID = 7363379256768742855L;

    public OpenIdConnectException(final ErrorCode error) {

        this(new ErrorResponse(error));
    }

    public OpenIdConnectException(final ErrorCode error, final String errorDescription) {

        this(new ErrorResponse(error, errorDescription));
    }

    public OpenIdConnectException(final ErrorCode error, final String errorDescription, final URI errorUri) {

        this(new ErrorResponse(error, errorDescription, errorUri));
    }

    public OpenIdConnectException(final ErrorResponse errorResponse) {

        super(Response.ok(errorResponse)
                .type(MediaType.APPLICATION_JSON)
                .status(Status.BAD_REQUEST)
                .build());
    }
}
{'fraction_non_alphanumeric': 0.08690012970168612, 'fraction_numerical': 0.016428880242109815, 'mean_word_length': 3.4076190476190478, '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': '6207525', 'n_tokens_mistral': 664, 'n_tokens_neox': 616, 'n_words': 148}