X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fhash.rb;h=22763f311a5183158329ef4337875c60083007c7;hb=6963202b4b62c2816655ac9532521b018fdf83bd;hp=8cc4823be5a23b8b92f836b200022f87ff47838f;hpb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb index 8cc4823be..22763f311 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb @@ -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