lib/frontman/sitemap_tree.rb in frontman-ssg-0.0.3 vs lib/frontman/sitemap_tree.rb in frontman-ssg-0.0.4
- old
+ new
@@ -1,8 +1,10 @@
# typed: false
# frozen_string_literal: true
+require 'frontman/errors'
+
module Frontman
class SitemapTree
attr_reader :path, :children, :url_part
attr_accessor :parent, :position, :resource, :url
@@ -190,22 +192,8 @@
@@urls
end
def inspect
"SitemapTree: #{@resource ? @resource.destination_path : @url_part}"
- end
- end
-
- class DuplicateResourceError < StandardError
- def self.create(resource, url, existing_resource)
- new("Unable to add #{resource.file_path} as #{url}.
- Resource #{existing_resource.file_path} already exists on this URL.")
- end
- end
-
- class ExistingRedirectError < StandardError
- def self.create(resource, url)
- new("Unable to add #{resource.file_path} as #{url}.
- A redirect already exists for this URL.")
end
end
end