All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nike.riposte.server.error.exception.Unauthorized401Exception Maven / Gradle / Ivy

There is a newer version: 0.20.0
Show newest version
package com.nike.riposte.server.error.exception;

import com.nike.internal.util.Pair;

import java.util.ArrayList;
import java.util.List;

/**
 * Thrown when a request does not have a valid authorization header. Represents a HTTP 401 response code.
 *
 * @author Florin Dragu
 */
public class Unauthorized401Exception extends RuntimeException {

    public final String requestPath;
    public final String authorizationHeader;
    public final List> extraDetailsForLogging;

    public Unauthorized401Exception(String message, String requestPath, String authorizationHeader) {
        this(message, requestPath, authorizationHeader, new ArrayList<>());
    }

    public Unauthorized401Exception(String message, String requestPath, String authorizationHeader,
                                    List> extraDetailsForLogging) {
        super(message);

        this.requestPath = requestPath;
        this.authorizationHeader = authorizationHeader;
        this.extraDetailsForLogging = extraDetailsForLogging;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy