Sha256: 3ff3c31df46dd4c45990e325b8335b0d8e371a14e4d1fb4b803d0a1ca09d6cb2

Contents?: true

Size: 290 Bytes

Versions: 2

Compression:

Stored size: 290 Bytes

Contents

module Landable
  class Error < StandardError
    STATUS_CODE = 500

    def initialize(message = nil)
      message ||= "Status code: #{status_code} (Hint: rescue this in your ApplicationController)"
      super
    end

    def status_code
      self.class::STATUS_CODE
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 lib/landable/error.rb
landable-1.13.2 lib/landable/error.rb