]> git.ipfire.org Git - thirdparty/squid.git/blob - src/err_detail_type.h
Support libecap::host::xaction::blockVirgin() API, serving ERR_ACCESS_DENIED.
[thirdparty/squid.git] / src / err_detail_type.h
1 #ifndef _SQUID_ERR_DETAIL_H
2 #define _SQUID_ERR_DETAIL_H
3
4 typedef enum {
5 ERR_DETAIL_NONE,
6 ERR_DETAIL_START = 100000, // to avoid clashes with most OS error numbers
7 ERR_DETAIL_CLT_REQMOD_ABORT = ERR_DETAIL_START, // client-side detected transaction abort
8 ERR_DETAIL_CLT_REQMOD_REQ_BODY, // client-side detected REQMOD request body adaptation failure
9 ERR_DETAIL_CLT_REQMOD_RESP_BODY, // client-side detected REQMOD satisfaction reply body failure
10 ERR_DETAIL_ICAP_RESPMOD_EARLY, // RESPMOD failed w/o store entry
11 ERR_DETAIL_ICAP_RESPMOD_LATE, // RESPMOD failed with a store entry
12 ERR_DETAIL_REQMOD_BLOCK, // REQMOD denied client access
13 ERR_DETAIL_RESPMOD_BLOCK_EARLY, // RESPMOD denied client access to HTTP response, before any part of the response was sent
14 ERR_DETAIL_RESPMOD_BLOCK_LATE, // RESPMOD denied client access to HTTP response, after [a part of] the response was sent
15 ERR_DETAIL_ICAP_XACT_START, // transaction start failure
16 ERR_DETAIL_ICAP_XACT_BODY_CONSUMER_ABORT, // transaction body consumer gone
17 ERR_DETAIL_ICAP_INIT_GONE, // initiator gone
18 ERR_DETAIL_ICAP_XACT_CLOSE, // ICAP connection closed unexpectedly
19 ERR_DETAIL_ICAP_XACT_OTHER, // other ICAP transaction errors
20 ERR_DETAIL_EXCEPTION_OTHER, //other errors ( eg std C++ lib errors)
21 ERR_DETAIL_MAX,
22 ERR_DETAIL_EXCEPTION_START = 110000 // offset for exception ID details
23 } err_detail_type;
24
25 extern const char *err_detail_type_str[];
26
27 inline
28 const char *errorDetailName(int errDetailId)
29 {
30 if (errDetailId < ERR_DETAIL_START)
31 return "SYSERR";
32
33 if (errDetailId < ERR_DETAIL_MAX)
34 return err_detail_type_str[errDetailId-ERR_DETAIL_START+2];
35
36 if (errDetailId >=ERR_DETAIL_EXCEPTION_START)
37 return "EXCEPTION";
38
39 return "UNKNOWN";
40 }
41
42 #endif