class Spud::RequestError < StandardError attr_accessor :request_url, :item, :template attr_reader :code, :title def initialize(message) @template ||= 'layouts/error_page' super(message) end end class Spud::AccessDeniedError < Spud::RequestError def initialize(opts={}) @item = opts[:item] || 'page' @template = opts[:template] @code = 403 @title = "Access Denied" super("You are not authorized to view the requested #{item.downcase}.") end end class Spud::NotFoundError < Spud::RequestError def initialize(opts={}) @item = opts[:item] || 'page' @template = opts[:template] @code = 404 @title = "Not Found" super("The #{item.downcase} you were looking for could not be found.") end end