diff options
author | Adrien Thebo <git@somethingsinistral.net> | 2013-08-12 11:20:46 -0700 |
---|---|---|
committer | Adrien Thebo <git@somethingsinistral.net> | 2013-08-12 11:20:46 -0700 |
commit | e63715ddaf7c2e5a742ce29e5e159b6031918963 (patch) | |
tree | b73fe9d8c1a0d3706da7c490776ac6cfe825c5ea /lib/puppet/parser/functions | |
parent | 2cfa408909cd8a1d465e76d0487fea204f55b844 (diff) | |
download | puppet-stdlib-e63715ddaf7c2e5a742ce29e5e159b6031918963.tar.gz puppet-stdlib-e63715ddaf7c2e5a742ce29e5e159b6031918963.tar.bz2 |
(maint) reword error messages for validate_slength
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r-- | lib/puppet/parser/functions/validate_slength.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |