Module: Landable::Page::Errors
- Extended by:
- ActiveSupport::Concern
- Included in:
- Landable::Page
- Defined in:
- app/models/landable/page.rb
Defined Under Namespace
Classes: GoneError
Instance Method Summary collapse
Instance Method Details
#error ⇒ Object
253 254 255 256 257 258 259 260 261 262 |
# File 'app/models/landable/page.rb', line 253 def error return nil unless error? case status_code when 410 GoneError.new else Landable::Error.new "Missing a Page error class for #{status_code}" end end |
#error? ⇒ Boolean
249 250 251 |
# File 'app/models/landable/page.rb', line 249 def error? (400..599).cover? status_code end |