let JSON::Parser error rise to end user

Julien Girard committed Apr 30, 2018
commit 71ed4f2c1727c0424479dfc3dfbb051881de6634
Showing 2 changed files with 1 additions and 3 deletions
locomotive/steam/adapters/filesystem/sanitizers/section.rb b/lib/locomotive/steam/adapters/filesystem/sanitizers/section.rb +0 -2
@@ @@ -20,8 +20,6 @@ module Locomotive::Steam
json, template = match[:json], match[:template]
entity.definition = JSON.parse(json)
entity.template = template
- rescue JSON::ParserError
- raise_parsing_error(entity, content)
end
def raise_parsing_error(entity, content)
spec/unit/adapters/filesystem/sanitizers/section_spec.rb +1 -1
@@ @@ -57,7 +57,7 @@ LIQUID
let(:template_path) { 'spec/fixtures/errors/section_bad_json_content.liquid' }
it 'should throw an error' do
- expect { subject }.to raise_error(Locomotive::Steam::ParsingRenderingError)
+ expect { subject }.to raise_error(JSON::ParserError)
end
end
end