]> git.ipfire.org Git - thirdparty/squid.git/blob - src/err_detail_type.h
Author: Leonid Evdokimov <leon@darkk.net.ru>
[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_ICAP_XACT_START, // transaction start failure
13 ERR_DETAIL_ICAP_XACT_BODY_CONSUMER_ABORT, // transaction body consumer gone
14 ERR_DETAIL_ICAP_INIT_GONE, // initiator gone
15 ERR_DETAIL_ICAP_XACT_CLOSE, // ICAP connection closed unexpectedly
16 ERR_DETAIL_ICAP_XACT_OTHER, // other ICAP transaction errors
17 ERR_DETAIL_EXCEPTION_OTHER, //other errors ( eg std C++ lib errors)
18 ERR_DETAIL_MAX,
19 ERR_DETAIL_EXCEPTION_START = 110000 // offset for exception ID details
20 } err_detail_type;
21
22 extern const char *err_detail_type_str[];
23
24 inline
25 const char *errorDetailName(int errDetailId)
26 {
27 if (errDetailId < ERR_DETAIL_START)
28 return "SYSERR";
29
30 if (errDetailId < ERR_DETAIL_MAX)
31 return err_detail_type_str[errDetailId-ERR_DETAIL_START+2];
32
33 if (errDetailId >=ERR_DETAIL_EXCEPTION_START)
34 return "EXCEPTION";
35
36 return "UNKNOWN";
37 }
38
39 #endif