1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.hpd;
17
18 import lombok.Getter;
19 import org.openehealth.ipf.commons.ihe.hpd.stub.dsmlv2.ErrorResponse.ErrorType;
20
21 import static java.util.Objects.requireNonNull;
22
23
24
25
26 public class HpdException extends RuntimeException {
27
28 @Getter private final ErrorType type;
29
30 public HpdException(String message, ErrorType type) {
31 super(message);
32 this.type = requireNonNull(type);
33 }
34
35 public HpdException(Exception exception, ErrorType type) {
36 super(exception.getMessage());
37 this.type = requireNonNull(type);
38 }
39 }