slimmer 1.1.30 → 1.1.31

Sign up to get free protection for your applications and to get access to all the features.
data/lib/slimmer/skin.rb CHANGED
@@ -70,10 +70,10 @@ module Slimmer
70
70
  cache template_name, template
71
71
  logger.debug "Slimmer: Returning evaluated template"
72
72
  template
73
- rescue OpenURI::HTTPError
74
- raise TemplateNotFoundException
75
- rescue Errno::ECONNREFUSED
76
- raise CouldNotRetrieveTemplate
73
+ rescue OpenURI::HTTPError => e
74
+ raise TemplateNotFoundException, "Unable to fetch: '#{template_name}' from '#{url}' because #{e}", caller
75
+ rescue Errno::ECONNREFUSED => e
76
+ raise CouldNotRetrieveTemplate, "Unable to fetch: '#{template_name}' from '#{url}' because #{e}", caller
77
77
  end
78
78
 
79
79
  def template_url template_name
@@ -99,8 +99,10 @@ module Slimmer
99
99
  errors = doc.errors.select {|e| e.error?}.reject {|e| ignorable?(e)}
100
100
  if errors.size > 0
101
101
  error = errors.first
102
- raise "In #{description_for_error_message}: '#{error.message}' at line #{error.line} col #{error.column} (code #{error.code}).\n" +
103
- context(html, error)
102
+ message = "In #{description_for_error_message}: '#{error.message}' at line #{error.line} col #{error.column} (code #{error.code}).\n"
103
+ message << "Add ?skip_slimmer=1 to the url to show the raw backend request.\n\n"
104
+ message << context(html, error)
105
+ raise message
104
106
  end
105
107
  end
106
108
  doc
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = '1.1.30'
2
+ VERSION = '1.1.31'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: slimmer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.30
5
+ version: 1.1.31
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben Griffiths
@@ -193,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - ">="
195
195
  - !ruby/object:Gem::Version
196
- hash: -400948941029337357
196
+ hash: -1996559435119057124
197
197
  segments:
198
198
  - 0
199
199
  version: "0"
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
203
  - - ">="
204
204
  - !ruby/object:Gem::Version
205
- hash: -400948941029337357
205
+ hash: -1996559435119057124
206
206
  segments:
207
207
  - 0
208
208
  version: "0"