]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(maint) reword error messages for validate_slength
authorAdrien Thebo <git@somethingsinistral.net>
Mon, 12 Aug 2013 18:20:46 +0000 (11:20 -0700)
committerAdrien Thebo <git@somethingsinistral.net>
Mon, 12 Aug 2013 18:20:46 +0000 (11:20 -0700)
lib/puppet/parser/functions/validate_slength.rb

index 8c8569a82cabb90c2eca11511324306f07a40140..68054b8e6ae266f17c6e9d58611cba313fa666aa 100644 (file)
@@ -26,20 +26,20 @@ module Puppet::Parser::Functions
     input, max_length, min_length = *args
 
     unless (input.is_a?(String) or input.is_a?(Array))
-      raise Puppet::ParseError, "validate_slength(): please pass a string, or an array of strings - what you passed didn't work for me at all - #{input.class}"
+      raise Puppet::ParseError, "validate_slength(): Expected first argument to be a String or Array, got a #{input.class}"
     end
 
     begin
       max_length = max_length.to_i
     rescue NoMethodError => e
-      raise Puppet::ParseError, "validate_slength(): Couldn't convert whatever you passed as the max length parameter to an integer  - sorry: " + e.message
+      raise Puppet::ParseError, "validate_slength(): Expected second argument to be a positive Numeric, got a #{max_length.class}"
     end
 
     unless args.length == 2
       begin
         min_length = Integer(min_length)
       rescue StandardError => e
-        raise Puppet::ParseError, "validate_slength(): Couldn't convert whatever you passed as the min length parameter to an integer  - sorry: " + e.message
+        raise Puppet::ParseError, "validate_slength(): Expected third argument to be unset or a positive Numeric, got a #{min_length.class}"
       end
     else
       min_length = 0