1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.waarp.icap;
22
23
24
25
26 public enum IcapError {
27
28
29
30 ICAP_CANT_CONNECT(1000, "Cannot connect to ICAP server"),
31
32
33
34 ICAP_SERVER_RESPONSE_CLOSE(1001,
35 "ICAP Server closed connection while reading response"),
36
37
38
39 ICAP_SERVER_RESPONSE_RESET(1002, "ICAP Server reset connection while " +
40 "reading response"),
41
42
43
44 ICAP_SERVER_UNKNOWN_CODE(1003, "ICAP Server sent unknown response code"),
45
46
47
48 ICAP_SERVER_UNEXPECTED_CLOSE_204(1004, "ICAP Server closed connection on " +
49 "204 without 'Connection: close' header"),
50
51
52
53 ICAP_SERVER_UNEXPECTED_CLOSE(1005, "ICAP Server closed connection as ICAP " +
54 "client wrote body preview"),
55
56
57
58 ICAP_SERVER_MISSING_INFO(1006,
59 "ICAP Server response missed some information"),
60
61
62
63 ICAP_NETWORK_ERROR(1007,
64 "Network error during communication with ICAP Server"),
65
66
67
68 ICAP_SERVER_HEADER_WITHOUT_TERMINATOR(1008, "ICAP Server sends a header " +
69 "without terminator"),
70
71
72
73 ICAP_SERVER_HEADER_EXCEED_CAPACITY(1009,
74 "ICAP Server sends a too big header"),
75
76
77
78 ICAP_SERVER_SERVICE_UNKNOWN(1010, "Service is unknown by the ICAP Server"),
79
80
81
82 ICAP_INTERNAL_ERROR(2000, "ICAP Client has an internal error"),
83
84
85
86 ICAP_ARGUMENT_ERROR(2001, "ICAP Client has wrong parameter"),
87
88
89
90 ICAP_TIMEOUT_ERROR(2002, "ICAP network operation has a timeout"),
91
92
93
94 ICAP_FILE_LENGTH_ERROR(2003, "ICAP Client has a too big file");
95
96
97 private final int code;
98 private final String message;
99
100 IcapError(final int code, final String message) {
101 this.code = code;
102 this.message = message;
103 }
104
105 public final int getCode() {
106 return code;
107 }
108
109 public final String getMessage() {
110 return message;
111 }
112 }