27 Jun 2012 00:44
Faces and Exceptions
Ken Barber <ken <at> puppetlabs.com>
2012-06-26 22:44:25 GMT
2012-06-26 22:44:25 GMT
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(Continue reading)
RSS Feed