diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-12-13 12:09:51 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-12-13 12:09:51 +0100 |
commit | f1c18611d7b6ff9e80a087c9c9042cfdfd821a0a (patch) | |
tree | e74f4b19bbc124cdfbd930eb032b545e293c8f63 /gnu-taler-error-codes/h.footer | |
parent | 7626b96d37ca125d8b9bf34db7b0305f11d02361 (diff) | |
download | gana-f1c18611d7b6ff9e80a087c9c9042cfdfd821a0a.tar.gz gana-f1c18611d7b6ff9e80a087c9c9042cfdfd821a0a.zip |
generate logic to lookup HTTP status code by ec, also safely
Diffstat (limited to 'gnu-taler-error-codes/h.footer')
-rw-r--r-- | gnu-taler-error-codes/h.footer | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu-taler-error-codes/h.footer b/gnu-taler-error-codes/h.footer index 67d90c8..714e7f4 100644 --- a/gnu-taler-error-codes/h.footer +++ b/gnu-taler-error-codes/h.footer | |||
@@ -19,10 +19,22 @@ TALER_ErrorCode_get_hint (enum TALER_ErrorCode ec); | |||
19 | * @param ec the error code. | 19 | * @param ec the error code. |
20 | * @return the HTTP status code for the given @a ec, UINT_MAX if not found | 20 | * @return the HTTP status code for the given @a ec, UINT_MAX if not found |
21 | */ | 21 | */ |
22 | const unsigned int | 22 | unsigned int |
23 | TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec); | 23 | TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec); |
24 | 24 | ||
25 | 25 | ||
26 | /** | ||
27 | * Return HTTP status for a given error code that is guaranteed | ||
28 | * to work (no corner cases). | ||
29 | * | ||
30 | * @param ec the error code. | ||
31 | * @return the HTTP status code for the given @a ec, 500 if | ||
32 | * the @a ec is not found or is a client-side code | ||
33 | */ | ||
34 | unsigned int | ||
35 | TALER_ErrorCode_get_http_status_safe (enum TALER_ErrorCode ec); | ||
36 | |||
37 | |||
26 | #if 0 /* keep Emacsens' auto-indent happy */ | 38 | #if 0 /* keep Emacsens' auto-indent happy */ |
27 | { | 39 | { |
28 | #endif | 40 | #endif |