Closed DioF closed 10 years ago
@DioF - thank you for the report. Looking closer into this there were a few issues here, but yes, simply removing the inner exception block returns the correct error message to the host.
Fixed.
Incidentally before removing that code I found a couple of other issues that were caused by ignoring that error which resulted in the null exception as the effectively the model was passed in as null. This now fixes a few other edge cases.
Thanks again.
It's checked in on the V3.0 branch.
Alright, I've updated my references. Works great! Thanks for your time and work.
When one writes a template using a specific model type (not dynamic) and the template is rendered with a different model type, the rendering fails without an exception. The only hint is a misleading text in RazorEngine.ErrorMessage saying
The reason for this is IMO a wrong try ... catch block in RazorEngine, which catches the precise exception and ignores it.
msg is not used anymore although it would contain the perfect text
I suggest to remove this try ... catch block as the outer try ... catch will do the exception handling the way I would expect.