Shopify/liquid — pull request #349 by tjoyal (2014-04-30 20:30:30+00:00)
Title: Prevent template to use render! in presence of an unsafe context

It was possible to pass a context without `rethrow_errors` to the method `render!`. On error it would act as what the context passed dictate and not re-throw errors.

This was giving the impression it was safe for the parsed template to be exposed publicly where it could contain ruby error messages embedded at the location of the failing method call.

### Considering: ###
```
class TestDrop < Liquid::Drop
def failing
raise 'Ruby error in my code'
end
end
```

### Before: ###
```
context = Liquid::Context.new({'test' => TestDrop.new}, {}, {}, false)
Liquid::Template.parse('{{ test.failing }}').render!(context)
=> "Liquid error: Ruby error in my code"

context = Liquid::Context.new({'test' => TestDrop.new}, {}, {}, true)
Liquid::Template.parse('{{ test.failing }}').render!(context)
=> RuntimeError: Ruby error in my code
```

### After: ###
```
context = Liquid::Context.new({'test' => TestDrop.new}, {}, {}, false)
Liquid::Template.parse('{{ test.failing }}').render!(context)
=> Liquid::ArgumentError: Unable to set re-throw error policy on the context provided as parameter

context = Liquid::Context.new({'test' => TestDrop.new}, {}, {}, true)
Liquid::Template.parse('{{ test.failing }}').render!(context)
=> RuntimeError: Ruby error in my code
```

What do you guys think? @fw42 @gmalette