Hi all, So I'm reworking part of the forge search error handling to deal with throwing meaningful SSL messages (see my previous message). My goal so you can step back and tell me my approach is completely wrong: I want to capture SSL verification failures so I can tell a user that the OpenSSL CA bundle needs work basically. I originally went to just add another Puppet.err output in the puppet/forge/repository.rb part, but then I stopped and realised I should be really just raising exceptions here so higher levels can display the output - my wariness comes from the fact that I want to see Puppet::Forge more as an API for general usage - and avoid assumptions at that level about how the consumer wishes to display errors. So with the intent that I should fix things properly, not just let them simmer ... I headed down another path in the last couple of hours trying to solve this properly.
Anyway given that I want to instead ripple exceptions up to the caller instead ... I noticed part of the module face code introduced this concept of 'multiline' methods on exceptions, and looking at what has been written a lot of wrapping code in the faces 'application' bits has been added to coerce these into a results hash so the Face can render them. I can't help but think this is extra typing though, and I'd rather that if I raise an exception in the 'when_invoked' block the message gets rendered on its own, multiline or single line. I'm sort of swimming in a see of uncertainty regarding the original aim here for failure in a face - I can gather that a multi-line variant was experimented on in this code specifically for the module stuff, but if this is something we wish to go forward with should it be something that the faces can just deal with? Should I be capturing exceptions, passing them as data and coercing them into Puppet.err output in the when_rendering block? Or was there a greater goal for dealing with errors. A good old 'on_exception' block inside a face would be nice for me to deal with custom errors in some failure cases, but I can't see if this was ever done - perhaps I'm totally wrong. Or perhaps this isn't right, and we should be handling multiline exceptions at a higher level, I guess I'm looking for what the 'intent' or pre-thought was around handling exceptions and displaying meaningful errors from these was in the Face code and how perhaps this fits into my goals and the module face multline exceptions. Again as usual, any help is much appreciated. ken. -- 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.
