From ed54c145b7af36b7c0fc4becba2ca84879296e79 Mon Sep 17 00:00:00 2001 From: garronej Date: Mon, 1 Nov 2021 22:15:56 +0100 Subject: [PATCH] Make it more easy to understand that error in the log are expected --- README.md | 16 +++++++++------- .../build-keycloak-theme/generateFtl/common.ftl | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0947f34f..a84ea3f1 100644 --- a/README.md +++ b/README.md @@ -444,18 +444,20 @@ The logs of your keycloak server will always show this kind of errors every time ```log FTL stack trace ("~" means nesting-related): - - Failed at: #local value = object[key] [in template "login.ftl" in macro "objectToJson" at line 70, column 21] - - Reached through: @compress [in template "login.ftl" in macro "objectToJson" at line 36, column 5] - - Reached through: @objectToJson object=value depth=(dep... [in template "login.ftl" in macro "objectToJson" at line 81, column 27] - - Reached through: @compress [in template "login.ftl" in macro "objectToJson" at line 36, column 5] - - Reached through: @objectToJson object=(.data_model) de... [in template "login.ftl" at line 163, column 43] + - Failed at: #local value = object[key] [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 70, column 21] + - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5] + - Reached through: @objectToJson_please_ignore_errors object=value depth=(dep... [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 81, column 27] + - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5] + - Reached through: @objectToJson_please_ignore_errors object=(.data_model) de... [in template "login.ftl" at line 163, column 43] ``` -Theses are expected and can be safely ignored. +Theses are expected to show up in the log. +Unfortunately, there is nothing I know of that can be done to avoid them or even mute them. +They can be, however, safely ignored. To [converts the `.ftl` values into a JavaScript object](https://github.com/InseeFrLab/keycloakify/blob/main/src/bin/build-keycloak-theme/generateFtl/common.ftl) without making assumptions on the `.data_model` we have to do things that throws. -It's all-right though because every statement that can fail is inside an `<#attempt><#recorver>` block but it results in errors being printed to the logs. +It's all-right because every statement that can fail is inside an `<#attempt><#recorver>` block but it results in errors being printed to the logs. # Adding custom message (to `i18n/useKcMessage.tsx`) diff --git a/src/bin/build-keycloak-theme/generateFtl/common.ftl b/src/bin/build-keycloak-theme/generateFtl/common.ftl index 2172adc7..5323e896 100644 --- a/src/bin/build-keycloak-theme/generateFtl/common.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/common.ftl @@ -1,5 +1,5 @@