1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package cz.hobrasoft.pdfmu.jackson;
18
19 import com.fasterxml.jackson.annotation.JsonInclude;
20 import com.fasterxml.jackson.annotation.JsonInclude.Include;
21 import com.fasterxml.jackson.annotation.JsonProperty;
22 import com.fasterxml.jackson.annotation.JsonPropertyDescription;
23 import java.util.Map;
24
25
26
27
28
29 public class RpcError {
30
31 @JsonPropertyDescription("A Number that indicates the error type that occurred.")
32 @JsonProperty(required = true)
33 public int code;
34
35 @JsonPropertyDescription("A String providing a short description of the error.\n"
36 + "The message SHOULD be limited to a concise single sentence.")
37 @JsonProperty(required = true)
38 public String message;
39
40 public static class Data {
41
42 @JsonInclude(Include.NON_NULL)
43 public Class causeClass;
44
45 @JsonInclude(Include.NON_NULL)
46 public String causeMessage;
47
48 @JsonInclude(Include.NON_NULL)
49 public Map<String, Object> arguments;
50 }
51
52 @JsonPropertyDescription("A Primitive or Structured value that contains additional information about the error.\n"
53 + "This may be omitted.\n"
54 + "The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).")
55 @JsonInclude(Include.NON_NULL)
56 public Data data;
57
58 public RpcError(int code, String message) {
59 this.code = code;
60 this.message = message;
61 }
62 }