nickel-org / rust-mustache

mustache template library for rust
Other
204 stars 62 forks source link

fix(panics): return Results instead of runtime panics #36

Closed Ryman closed 8 years ago

Ryman commented 8 years ago

This should remove runtime panics in most cases, there are a few bug! panics remaining but if they fire it's likely a logic error in mustache itself rather than a data problem and should be logged & fixed.

Issue #29 calls for returning io::Error specifically, but since a Template could invoke a closure which would need to compile the returned (String) Template there are more failure conditions than just the IO cases. It should be possible to map_err to reduce to io::Error if required.