novu
novu copied to clipboard
fix: add try catch condition in handlebar template compilation
What change does this PR introduce?
Add try catch condition for handlebars template compilation Add new detail enum value
Why was this change needed?
Closes #2229
Other information (Screenshots)

Fix @scopsy comments and I think it is ready to merge :)
@scopsy shifted try catch one level above and added handlebar error in execution details
Hi @jainpawan21 , correct me if I'm wrong, but this still won't apply to the other channels, right? Like sms, in app, push etc
Hi @jainpawan21 , correct me if I'm wrong, but this still won't apply to the other channels, right? Like sms, in app, push etc
Yes, You are right, it will handle only email syntax error
I've actually been working on something similar before I noticed your PR 🙈 Would you mind if I join you on this one and push some of my changes? @jainpawan21
I've actually been working on something similar before I noticed your PR 🙈 Would you mind if I join you on this one and push some of my changes? @jainpawan21
Yes sure Gali
@jainpawan21 I added the try catch to also be on the first render&compile (not only on the html). And also to wrap the compiles for subject, preheader, cta etc . Also changed it for all channels. Pawan, please let me know what you think :)
@ainouzgali what do you think also adding a validation on the client side? So we can even skip the server request if the compile message fails on the client?
@scopsy Yes, I definitely want that. I've started looking into that, but it is not as straight forward. I will continue at the next cool down. Or, we could open it for the community, in case someone will be available to help on this.
Also. I wouldn't do it on the client, but rather on save/update of template.