diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-05-12 13:40:22 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-05-12 13:40:22 +0200 |
commit | 4833234df63d7da774299b336adb925e700bd4b4 (patch) | |
tree | abb478b860c2d3f292ded9364300ce73b1d60d11 /src/include/taler_templating_lib.h | |
parent | 9130cda9e775131d3ced613b7f238a4c9e43ad5a (diff) | |
parent | ff1a28319fe31741958a0b1cfa761fd44878db45 (diff) | |
download | exchange-4833234df63d7da774299b336adb925e700bd4b4.tar.xz |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'src/include/taler_templating_lib.h')
-rw-r--r-- | src/include/taler_templating_lib.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h index 53946b9c0..6af6db715 100644 --- a/src/include/taler_templating_lib.h +++ b/src/include/taler_templating_lib.h @@ -22,7 +22,7 @@ #define TALER_TEMPLATING_LIB_H #include <microhttpd.h> - +#include "taler_mhd_lib.h" /** * Fill in Mustach template @a tmpl using the data from @a root @@ -91,6 +91,26 @@ TALER_TEMPLATING_reply (struct MHD_Connection *connection, const char *taler_uri, const json_t *root); + +/** + * Load a @a template and substitute an error message based on @a ec and @a + * detail, returning the result to the @a connection with the given @a + * http_status code. + * + * @param connection the connection we act upon + * @param template_basename basename of the template to load + * @param http_status code to use on success + * @param ec error code to return + * @param detail optional text to add to the template + * @return #MHD_YES on success, #MHD_NO to just close the connection + */ +MHD_RESULT +TALER_TEMPLATING_reply_error (struct MHD_Connection *connection, + const char *template_basename, + unsigned int http_status, + enum TALER_ErrorCode ec, + const char *detail); + /** * Preload templates. * |