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

#errorObject



266
267
268
269
270
271
272
273
274
275
# File 'app/models/landable/page.rb', line 266

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

Returns:

  • (Boolean)


262
263
264
# File 'app/models/landable/page.rb', line 262

def error?
  (400..599).cover? status_code
end