diff options
-rw-r--r-- | bugzilla.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bugzilla.rb b/bugzilla.rb index d22cf44..2971939 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -108,6 +108,15 @@ class BugzillaPlugin < Plugin "Bug ##{@bugno} not found in #{@zilla}" end end + + # Exception class for bugs that are security-locked + # It is thrown when the XML document does not contain either a <bug> + # or <issue> element that is recognised. + class ENotPermitted < Exception + def message + "No permissions to access Bug ##{@bugno} in #{@zilla}" + end + end # Exception class for an invalid bugzilla instance data. # @@ -309,6 +318,15 @@ class BugzillaPlugin < Plugin bugxml.attribute("error").to_s.downcase == "notfound" raise ENotFound.new(name, bugno) end + bug_error = bugxml.attribute("error").to_s + if bug_error.length > 0 + case bug_error.downcase + when "notpermitted" + raise ENotPermitted.new(name, bugno) + else + raise EErrorParsing.new(name, bugno) + end + end product_component = "#{bugxml.get_text("product")} | #{bugxml.get_text("component")}". |