aboutsummaryrefslogtreecommitdiff
path: root/gnu-taler-error-codes/c.footer
diff options
context:
space:
mode:
Diffstat (limited to 'gnu-taler-error-codes/c.footer')
-rw-r--r--gnu-taler-error-codes/c.footer18
1 files changed, 17 insertions, 1 deletions
diff --git a/gnu-taler-error-codes/c.footer b/gnu-taler-error-codes/c.footer
index 118aa08..163901f 100644
--- a/gnu-taler-error-codes/c.footer
+++ b/gnu-taler-error-codes/c.footer
@@ -27,7 +27,7 @@ TALER_ErrorCode_get_hint (enum TALER_ErrorCode ec)
27} 27}
28 28
29 29
30const unsigned int 30unsigned int
31TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec) 31TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec)
32{ 32{
33 unsigned int lower = 0; 33 unsigned int lower = 0;
@@ -51,3 +51,19 @@ TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec)
51 } 51 }
52 return UINT_MAX; 52 return UINT_MAX;
53} 53}
54
55
56unsigned int
57TALER_ErrorCode_get_http_status_safe (enum TALER_ErrorCode ec)
58{
59 unsigned int hc;
60
61 hc = TALER_ErrorCode_get_http_status (ec);
62 if ( (0 == hc) ||
63 (UINT_MAX == hc) )
64 {
65 GNUNET_break (0);
66 return MHD_HTTP_INTERNAL_SERVER_ERROR;
67 }
68 return hc;
69}