From 404b2b78f187e3da2fedee5748b9bfcdfa4a105c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 6 May 2023 20:55:40 +0200 Subject: add convenience function TALER_TEMPLATING_reply_error --- src/include/taler_templating_lib.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/include/taler_templating_lib.h') diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h index 53946b9c..ebda2ecf 100644 --- a/src/include/taler_templating_lib.h +++ b/src/include/taler_templating_lib.h @@ -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 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. * -- cgit v1.2.3 From 1639cefa617435ac4df5a8cd70c298aa1e1a820a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 6 May 2023 21:29:43 +0200 Subject: -doxygen --- contrib/gana | 2 +- src/include/taler_templating_lib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include/taler_templating_lib.h') diff --git a/contrib/gana b/contrib/gana index 4654d82b..e50e3767 160000 --- a/contrib/gana +++ b/contrib/gana @@ -1 +1 @@ -Subproject commit 4654d82b143cd69dfe7a7bf2f816f6f91f6052e2 +Subproject commit e50e37672fae7983fb5e934cd1d381b92648f7b6 diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h index ebda2ecf..a4665a11 100644 --- a/src/include/taler_templating_lib.h +++ b/src/include/taler_templating_lib.h @@ -98,7 +98,7 @@ TALER_TEMPLATING_reply (struct MHD_Connection *connection, * http_status code. * * @param connection the connection we act upon - * @param template basename of the template to load + * @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 -- cgit v1.2.3 From d1379e492de19070a8f7c2c3dba70f39fe956888 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 9 May 2023 14:11:21 +0200 Subject: -fix include --- src/include/taler_templating_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/taler_templating_lib.h') diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h index a4665a11..6af6db71 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 - +#include "taler_mhd_lib.h" /** * Fill in Mustach template @a tmpl using the data from @a root -- cgit v1.2.3