On Monday, May 16, 2011 at 10:34 AM, Matt Robinson wrote:
Contrary to the current code and ticket #7314 I think syntax errors in
> Faces should raise errors immediately instead of just warning in the
> log. I could be convinced otherwise, but the discussion with the
> original coder of the current behavior and the aforementioned ticket
> haven't done so. Generally I think code should fail early so that
> it's easier to debug and fix, rather than continue and then end up
> giving you problems that aren't nearly as clear.
> 
> While trying to debug some Faces to work in Ruby 1.9.2 I found that
> syntax errors in the face aren't raised, the face just fails to load
> and you get:
> 
>  lib/puppet/interface.rb:61:in `[]': Could not find Puppet Face
> :certificate (Puppet::Error)
> 
> The real reason you can't find the face was
> 
>  /Users/matthewrobinson/work/puppet/lib/puppet/face/certificate.rb:11:
>  invalid multibyte char (US-ASCII)
> 
> But unless you know to check the logs, it will take some digging to
> figure out why that face wasn't loaded.
> 
> Thoughts?
> 
I don't think this behavior is exactly undesirable. IIRC the intent was for 
external faces that were being developed by a user not to affect the 
functionality of core Puppet. However, for that to be the actual behavior, we 
need to distinguish between faces in core Puppet and external faces.

We don't currently have any similar facilities to guard against other types of 
plugins, which makes this behavior at least surprising. But it's also more 
correct, and setting a new standard of correctness seems, in this case, better 
than consistent incorrectness.

As for the confusing error messages: we can and should improve those.

> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to