|
41 | 41 | import org.apache.commons.lang3.ArrayUtils; |
42 | 42 | import org.apache.commons.lang3.BooleanUtils; |
43 | 43 | import org.apache.commons.lang3.StringUtils; |
| 44 | +import org.apache.commons.lang3.exception.ExceptionUtils; |
44 | 45 | import org.apache.commons.text.StringEscapeUtils; |
45 | 46 | import org.apache.commons.text.translate.AggregateTranslator; |
46 | 47 | import org.apache.commons.text.translate.CharSequenceTranslator; |
@@ -7073,20 +7074,21 @@ public void ecrireClasseCommentaireChamp(Jinjava jinjava, String langueNom, Json |
7073 | 7074 | } |
7074 | 7075 | }); |
7075 | 7076 |
|
7076 | | - Arrays.asList(String.format(jsonObject2.getString(champ2), formatValues).split("\n")).stream().forEach(s -> { |
7077 | | - b.append(s).append("\n"); |
7078 | | - }); |
7079 | | - if(condition && !"01_commentaire".equals(champ1)) { |
7080 | | - String rendered = jinjava.render(b.toString(), ctx); |
7081 | | - if("suggere".equals(champ2) || "todo".equals(champ2)) { |
7082 | | - w.s("<li>", rendered, "</li>"); |
7083 | | - } else { |
7084 | | - w.s(rendered); |
| 7077 | + try { |
| 7078 | + Arrays.asList(String.format(jsonObject2.getString(champ2), formatValues).split("\n")).stream().forEach(s -> { |
| 7079 | + b.append(s).append("\n"); |
| 7080 | + }); |
| 7081 | + if(condition && !"01_commentaire".equals(champ1)) { |
| 7082 | + String rendered = jinjava.render(b.toString(), ctx); |
| 7083 | + if("suggere".equals(champ2) || "todo".equals(champ2)) { |
| 7084 | + w.s("<li>", rendered, "</li>"); |
| 7085 | + } else { |
| 7086 | + w.s(rendered); |
| 7087 | + } |
7085 | 7088 | } |
| 7089 | + } catch(Throwable ex) { |
| 7090 | + LOG.error(String.format("Error occured while formatting field %s %s data %s with format values %s", champ1, champ2, jsonObject2.getString(champ2), Arrays.toString(formatValues)), ex); |
7086 | 7091 | } |
7087 | | - if(!"todo".equals(champ2)) |
7088 | | - jsonObject2Langue.put(champ2, b.toString()); |
7089 | | - |
7090 | 7092 | } |
7091 | 7093 |
|
7092 | 7094 | public void ecrireClasseCommentaireChamp2(Jinjava jinjava, String langueNom, JsonObject jsonObject, String champ1, ToutEcrivain w, Object valeur) { |
|
0 commit comments