aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/AuthorizationException.java
blob: 92d4aec39334a2d958b2a3eb2933bf2c6f73a6fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.rpc.security;

/**
 * @author bjorncs
 */
class AuthorizationException extends RuntimeException {

    enum Type {WARN, SILENT}

    private final Type type;

    AuthorizationException(Type type, String message) {
        super(message);
        this.type = type;
    }

    AuthorizationException(String message) {
        this(Type.WARN, message);
    }

    AuthorizationException(Type type, String message, Throwable cause) {
        super(message, cause);
        this.type = type;
    }

    AuthorizationException(String message, Throwable cause) {
        this(Type.WARN, message, cause);
    }

    Type type() { return type; }
}