summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-07-15 16:52:38 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-07-15 17:01:20 +0200
commit1d3812660714e910cd5efeed52661bb013d255f8 (patch)
tree0ea1d87aea01ad1d13323ef4d8588381552590be
parent37d7c0122bbda0212b949d7f8eb28245ba173a88 (diff)
Add exception type for 401 Unauthorized
-rw-r--r--container-core/src/main/java/com/yahoo/restapi/RestApiException.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/restapi/RestApiException.java b/container-core/src/main/java/com/yahoo/restapi/RestApiException.java
index 68e46a3a9b8..747cf1cedeb 100644
--- a/container-core/src/main/java/com/yahoo/restapi/RestApiException.java
+++ b/container-core/src/main/java/com/yahoo/restapi/RestApiException.java
@@ -78,4 +78,10 @@ public class RestApiException extends RuntimeException {
public Conflict(String message) { this(message, null); }
public Conflict(String message, Throwable cause) { super(ErrorResponse::conflict, message, cause); }
}
+
+ public static class Unauthorized extends RestApiException {
+ public Unauthorized() { this("Unauthorized", null); }
+ public Unauthorized(String message) { this(message, null); }
+ public Unauthorized(String message, Throwable cause) { super(ErrorResponse::unauthorized, message, cause); }
+ }
}