Update stdlib
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / hash.rb
index 8cc4823..22763f3 100644 (file)
@@ -14,8 +14,7 @@ Would return: {'a'=>1,'b'=>2,'c'=>3}
     EOS
   ) do |arguments|
 
-    raise(Puppet::ParseError, "hash(): Wrong number of arguments " +
-      "given (#{arguments.size} for 1)") if arguments.size < 1
+    raise(Puppet::ParseError, "hash(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size < 1
 
     array = arguments[0]
 
@@ -29,9 +28,8 @@ Would return: {'a'=>1,'b'=>2,'c'=>3}
       # This is to make it compatible with older version of Ruby ...
       array  = array.flatten
       result = Hash[*array]
-    rescue Exception
-      raise(Puppet::ParseError, 'hash(): Unable to compute ' +
-        'hash from array given')
+    rescue StandardError
+      raise(Puppet::ParseError, 'hash(): Unable to compute hash from array given')
     end
 
     return result