(maint) Improve message when type error is raised
Addresses @hlindberg's comment after PR #35 was closed. Use the error message from the exception which is actually exactly what I wanted to say anyway.
This commit is contained in:
parent
16186ef911
commit
641cba8c2d
|
@ -17,10 +17,9 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::HostClassHandler < PuppetX::
|
|||
else
|
||||
begin
|
||||
param_type_info[pop_param.name] = tp.interpret_any(pop_param.type_expr)
|
||||
rescue Puppet::ParseError
|
||||
rescue Puppet::ParseError => e
|
||||
# If the type could not be interpreted insert a prominent warning
|
||||
param_type_info[pop_param.name] = "TypeError - " +
|
||||
"#{pop_param.type_expr} isn't a valid type."
|
||||
param_type_info[pop_param.name] = "Type Error: #{e.message}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue