On Apr 28, 2009, at 10:37 PM, Brice Figureau wrote:
>
> On 28/04/09 15:41, Christian Hofstaedtler wrote:
>> From: Christian Hofstaedtler <[email protected]>
>> +[...]
>> +        begin
>> +            handler.process(request, response)
>> +        rescue => detail
>> +            # Send a Status 500 Error on unhandled exceptions.
>> +            response.status = 500
>> +            response['Content-Type'] = 'text/plain'
>> +            response.write 'Internal Server Error'
>> +            # log what happened
>> +            Puppet.err "Puppet Server (Rack): Internal Server  
>> Error: Unhandled Exception: \"%s\"" % detail.message
>> +            Puppet.err "Backtrace:"
>> +            detail.backtrace.each { |line| Puppet.err " > %s" %  
>> line }
>
> Other part of Puppet just do: puts detail.backtrace if Puppet[:trace]
> Are you doing this so that it ends in the passenger log or something?

We should probably have some module that handles the backtrace  
printing; I know others would sometimes like the backtraces in their  
logs instead of on the console, and there's no global bit for enabling  
that.  Without that, it's a bit arbitrary, and I'm fine having the  
trace sent to the logs.

Now that I think of it, I'm hoping to revamp the event system a bit in  
the next couple of releases, and we could have a backtrace event that  
handled this appropriately, including being able to send the whole  
backtrace in a transaction report as an array, rather than as printed  
logs.  That would be quite nice.

-- 
If all the world's a stage, I want to operate the trap door.
     -- Paul Beatty
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
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