package org.kairosdb.security.auth.core.exception;

import org.kairosdb.security.auth.core.functionnal.HttpResponse;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class UnauthorizedClientResponse extends Exception
{
    private final int weight;
    private final HttpResponse response;

    /**
     * Create new exception containing a weight and a lambda.<br>
     * The weight is used to define priority (more is better).
     *
     * @param weight Weight of the response (priority)
     * @param response Lambda constructing the response
     */
    public UnauthorizedClientResponse(int weight, HttpResponse response)
    {
        this.weight = weight;
        this.response = response;
    }

    public int weight()
    {
        return weight;
    }

    public void sendResponse(HttpServletResponse httpServletResponse) throws IOException
    {
        response.apply(httpServletResponse);
    }
}

@@ -653,32 +653,501 @@
 response)%0A    %7B%0A
+        super();%0A        this.weight = weight;%0A        this.response = response;%0A    %7D%0A%0A    /**%0A     * Create new exception containing a weight and a lambda.%3Cbr%3E%0A     * The weight is used to define priority (more is better).%0A     *%0A     * @param weight Weight of the response (priority)%0A     * @param response Lambda constructing the response%0A     */%0A    public UnauthorizedClientResponse(int weight, HttpResponse response, Throwable cause)%0A    %7B%0A        super(cause);%0A
         this.wei

Allow to create UnauthorizedClientResponse with another exception