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" message = opts[:message] || "You are not authorized to view the requested #{item.downcase}." super(message) end end class Spud::NotFoundError < Spud::RequestError def initialize(opts={}) @item = opts[:item] || 'page' @template = opts[:template] @code = 404 @title = "Not Found" message = opts[:message] || "The #{item.downcase} you were looking for could not be found." super(message) end end