From e63715ddaf7c2e5a742ce29e5e159b6031918963 Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Mon, 12 Aug 2013 11:20:46 -0700 Subject: (maint) reword error messages for validate_slength --- lib/puppet/parser/functions/validate_slength.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/parser/functions/validate_slength.rb b/lib/puppet/parser/functions/validate_slength.rb index 8c8569a..68054b8 100644 --- a/lib/puppet/parser/functions/validate_slength.rb +++ b/lib/puppet/parser/functions/validate_slength.rb @@ -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 -- cgit v1.2.3