From 1354202538b8955f59bef631f99f17237bfeeba1 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Tue, 18 Sep 2018 23:16:22 +0100 Subject: [PATCH] Create custom exception --- lib/uk_planning_scraper.rb | 2 ++ lib/uk_planning_scraper/authority.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/uk_planning_scraper.rb b/lib/uk_planning_scraper.rb index b7aaa2b..34abd18 100644 --- a/lib/uk_planning_scraper.rb +++ b/lib/uk_planning_scraper.rb @@ -5,4 +5,6 @@ require 'uk_planning_scraper/northgate' require 'logger' module UKPlanningScraper + class SystemNotSupportedError < StandardError + end end diff --git a/lib/uk_planning_scraper/authority.rb b/lib/uk_planning_scraper/authority.rb index 2df77a0..18e99ab 100644 --- a/lib/uk_planning_scraper/authority.rb +++ b/lib/uk_planning_scraper/authority.rb @@ -45,7 +45,7 @@ module UKPlanningScraper apps = self.scrape_northgate(authority.url, params, options) else # Not supported - raise "Planning system not supported for #{@name} at URL: #{@url}" + raise SystemNotSupportedError.new("Planning system not supported for #{@name} at URL: #{@url}") end # Post processing