Mailinglist Archive: opensuse-buildservice (120 mails)

< Previous Next >
[opensuse-buildservice] Re: [PATCH] [shared] No need to specify RuntimeError, it's the default exception type.
On Thursday 14 July 2011 09:27:57 you wrote:
From: Sascha Peilicke <saschpe@xxxxxxx>

Avoids Ruby not being able to distinguish an exception from a function:
'NoMethodError Exception: undefined method `RuntimeError' for
<ActiveXML::Base:...>'
---
buildservice/lib/activexml/node.rb | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/buildservice/lib/activexml/node.rb
b/buildservice/lib/activexml/node.rb index 798ec1d..b877a62 100644
--- a/buildservice/lib/activexml/node.rb
+++ b/buildservice/lib/activexml/node.rb
@@ -69,7 +69,7 @@ module ActiveXML
elsif stub.kind_of? LibXMLNode
self.raw_data = stub.dump_xml
else
- raise RuntimeError, "make_stub should return LibXMLNode or
String, was #{stub.inspect}" + raise "make_stub should return
LibXMLNode or String, was #{stub.inspect}" end
elsif data.kind_of? LibXMLNode
self.raw_data = data.dump_xml
@@ -144,7 +144,7 @@ module ActiveXML

def each_with_index(symbol = nil)
unless block_given?
- raise RuntimeError "use each instead"
+ raise "use each instead"
Even though the fix is ok, the reasoning was wrong, there was simply a comma
missing...

end
index = 0
nodes = Array.new
@@ -246,10 +246,10 @@ module ActiveXML

def delete_element( elem )
if elem.kind_of? LibXMLNode
- raise RuntimeError, "NO GOOD IDEA!" unless self.internal_data.doc
== elem.internal_data.doc + raise "NO GOOD IDEA!" unless
self.internal_data.doc == elem.internal_data.doc
elem.internal_data.remove!
elsif elem.kind_of? LibXML::XML::Node
- raise RuntimeError, "this should be obsolete!!!"
+ raise "this should be obsolete!!!"
elem.remove!
else
e = data.find_first(elem.to_s)

--
With kind regards,
Sascha Peilicke
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend├Ârffer HRB 16746 (AG N├╝rnberg)
< Previous Next >
This Thread
  • No further messages