Skip to content

Commit 055f09e

Browse files
committed
Catch template exceptions
1 parent 30ed524 commit 055f09e

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/main/java/org/computate/frFR/java/EcrireApiClasse.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4475,19 +4475,24 @@ else if(classeApiMethode.contains("DELETE")) {
44754475
tl(5, "Promise<Void> promise1 = Promise.promise();");
44764476
tl(5, classeApiOperationIdMethode, i18nGlobale.getString(I18n.var_Page), "Init(ctx, page, ", i18nGlobale.getString(I18n.var_liste), classeApiClasseNomSimple, ", promise1);");
44774477
tl(5, "promise1.future().onSuccess(b -> {");
4478-
tl(6, "Promise<String> promise2 = Promise.promise();");
4479-
tl(6, i18nGlobale.getString(I18n.var_template), classeApiMethode, classeNomSimple, "(ctx, page, ", i18nGlobale.getString(I18n.var_liste), classeNomSimple, ", promise2);");
4480-
tl(6, "promise2.future().onSuccess(renderedTemplate -> {");
4481-
tl(7, "try {");
4482-
tl(8, "Buffer buffer = Buffer.buffer(renderedTemplate);");
4483-
tl(8, "promise.complete(new ServiceResponse(200, \"OK\", buffer, ", i18nGlobale.getString(I18n.var_requeteEnTetes), "));");
4484-
tl(7, "} catch(Throwable ex) {");
4485-
tl(8, "LOG.error(String.format(\"", i18nGlobale.getString(I18n.var_reponse), "200", classeApiMethode, classeNomSimple, " ", i18nGlobale.getString(I18n.str_a_échoué), ". \"), ex);");
4478+
tl(6, "try {");
4479+
tl(7, "Promise<String> promise2 = Promise.promise();");
4480+
tl(7, i18nGlobale.getString(I18n.var_template), classeApiMethode, classeNomSimple, "(ctx, page, ", i18nGlobale.getString(I18n.var_liste), classeNomSimple, ", promise2);");
4481+
tl(7, "promise2.future().onSuccess(renderedTemplate -> {");
4482+
tl(8, "try {");
4483+
tl(9, "Buffer buffer = Buffer.buffer(renderedTemplate);");
4484+
tl(9, "promise.complete(new ServiceResponse(200, \"OK\", buffer, ", i18nGlobale.getString(I18n.var_requeteEnTetes), "));");
4485+
tl(8, "} catch(Throwable ex) {");
4486+
tl(9, "LOG.error(String.format(\"", i18nGlobale.getString(I18n.var_reponse), "200", classeApiMethode, classeNomSimple, " ", i18nGlobale.getString(I18n.str_a_échoué), ". \"), ex);");
4487+
tl(9, "promise.fail(ex);");
4488+
tl(8, "}");
4489+
tl(7, "}).onFailure(ex -> {");
44864490
tl(8, "promise.fail(ex);");
4487-
tl(7, "}");
4488-
tl(6, "}).onFailure(ex -> {");
4489-
tl(7, "promise.fail(ex);");
4490-
tl(6, "});");
4491+
tl(7, "});");
4492+
tl(6, "} catch(Throwable ex) {");
4493+
tl(7, "LOG.error(String.format(\"", i18nGlobale.getString(I18n.var_reponse), "200", classeApiMethode, classeNomSimple, " ", i18nGlobale.getString(I18n.str_a_échoué), ". \"), ex);");
4494+
tl(7, "promise.tryFail(ex);");
4495+
tl(6, "}");
44914496
tl(5, "}).onFailure(ex -> {");
44924497
tl(6, "promise.tryFail(ex);");
44934498
tl(5, "});");

0 commit comments

Comments
 (0)