Prior to this patch, if one tried to access a section (name) of a parsed KSS section comment that misses the section name definition, a NoMethodError: undefined method[]' for nil:NilClass` was thrown because the code assumed the Regex for finding the section name always succeeded.
To handle this error of a missing or wrongly formatted section name catching the very generic NoMethodError is not specific enough. I therefore introduced a SectionNotDefinedError that can be catched instead.
Prior to this patch, if one tried to access a section (name) of a parsed KSS section comment that misses the section name definition, a
NoMethodError: undefined method
[]' for nil:NilClass` was thrown because the code assumed the Regex for finding the section name always succeeded.To handle this error of a missing or wrongly formatted section name catching the very generic
NoMethodError
is not specific enough. I therefore introduced aSectionNotDefinedError
that can be catched instead.