diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-16 18:09:04 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-16 18:09:04 +0000 |
commit | b58ab6c33c0369e402109d5388d4f6f73b7eb2bb (patch) | |
tree | b4f09ac9cf03dd11328050ab1e26df5fad351695 /lib/banzai/reference_parser.rb | |
parent | 3940f59a61a749824aa4425ebdcaed6f3ed601f2 (diff) | |
download | gitlab-ce-b58ab6c33c0369e402109d5388d4f6f73b7eb2bb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai/reference_parser.rb')
-rw-r--r-- | lib/banzai/reference_parser.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/banzai/reference_parser.rb b/lib/banzai/reference_parser.rb index c08d3364a87..8b5d689a984 100644 --- a/lib/banzai/reference_parser.rb +++ b/lib/banzai/reference_parser.rb @@ -2,6 +2,8 @@ module Banzai module ReferenceParser + InvalidReferenceType = Class.new(StandardError) + # Returns the reference parser class for the given type # # Example: @@ -11,6 +13,8 @@ module Banzai # This would return the `Banzai::ReferenceParser::IssueParser` class. def self.[](name) const_get("#{name.to_s.camelize}Parser", false) + rescue NameError + raise InvalidReferenceType end end end |