1 | package com.yubico.fido.metadata; | |
2 | ||
3 | import lombok.Getter; | |
4 | import lombok.NonNull; | |
5 | ||
6 | public class FidoMetadataDownloaderException extends Exception { | |
7 | ||
8 | public enum Reason { | |
9 | BAD_SIGNATURE("Bad JWT signature."); | |
10 | ||
11 | private final String message; | |
12 | ||
13 | Reason(String message) { | |
14 | this.message = message; | |
15 | } | |
16 | } | |
17 | ||
18 | @NonNull @Getter | |
19 | /** The reason why this exception was thrown. */ | |
20 | private final Reason reason; | |
21 | ||
22 | /** A {@link Throwable} that caused this exception. May be null. */ | |
23 | @Getter private final Throwable cause; | |
24 | ||
25 |
1
1. <init> : negated conditional → KILLED |
FidoMetadataDownloaderException(@NonNull Reason reason, Throwable cause) { |
26 | super(cause); | |
27 | this.reason = reason; | |
28 | this.cause = cause; | |
29 | } | |
30 | ||
31 |
1
1. <init> : negated conditional → KILLED |
FidoMetadataDownloaderException(@NonNull Reason reason) { |
32 | this(reason, null); | |
33 | } | |
34 | ||
35 | @Override | |
36 | public String getMessage() { | |
37 |
1
1. getMessage : replaced return value with "" for com/yubico/fido/metadata/FidoMetadataDownloaderException::getMessage → NO_COVERAGE |
return reason.message; |
38 | } | |
39 | } | |
Mutations | ||
25 |
1.1 |
|
31 |
1.1 |
|
37 |
1.1 |