Introduce ParserError exception class

This commit is contained in:
Olle Jonsson
2015-10-21 23:13:42 +02:00
parent 2dda090e6b
commit 5a9928c18a
2 changed files with 4 additions and 2 deletions
@@ -1,4 +1,6 @@
module GitHubChangelogGenerator
ParserError = Class.new(StandardError)
class ParserFile
def initialize(options)
@options = options
@@ -22,7 +24,7 @@ module GitHubChangelogGenerator
value = false if value =~ (/^(false|f|no|n|0)$/i)
@options[key_sym] = value
rescue
raise "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
raise ParserError, "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
end
# Returns a the setting as a symbol and its string value sans newlines.