Subject: Developers of Sympa
List archive
- From: David Verdin <address@concealed>
- To: address@concealed
- Subject: Re: [sympa-developpers] Sympa and croak
- Date: Tue, 11 Dec 2012 15:07:46 +0100
Hi guys and sorry for this
late answer, Le 07/12/12 14:35, Guillaume Rousse a
écrit :
address@concealed">I think we need a consistent plan about error management here...If we try to summarize what we can demand from an error handling workflow in Sympa, do we agree on the following?
What we need indeed is that Sympa, in case of unrepairable error, holds whatever data it was holding, reports the error and goes on to the next request. Don't crash because, for some reason, we could not get the From field in a message. Carp modules are useful but what do they do that we don't do yet? When we raise an error, we return undef and log. The 'err' log level now adds a stack trace, so it is more or less the same as confess, but we don't kill the process. About the three advantages you point: 1) no more "everything requires the Log module because every piece of code has to report its error itself", which plays a large part in current cross-dependencies deadlockUnfortunately, I have no solution for this. that's actually an argument for Carp 2) easier unit-testing, as the caller code knows what is the error, instead of just being noticed an error occuredI don't see how unit-testing will be improved. Do the Carp subs return an error code or something? Finally, error handling, in some cases is done by returning structured data (a hash in which an "error" key was set, for example). You can't do that with Carp. Not really. Two subs are separated fo a reason. Logs are supposed to explain the context in which an error occurs. In your example, the calling sub could probably improve its log to explain what was the prupose of file rights change. In conclusion, I'd like to balance the risk of seeing Sympa crash for an unvalid reason to be balanced with the value added by thye usage of Carp. I'm really found of killing processes on development time, because it help us find bugs. In production, this is not the solution, I think. This would incline me to ban Carp module from Sympa. Except if, in each main loop of a Sympa daemon, we enclose the calls with eval. This way, no dameon could die, I think. Cheers, David |
Attachment:
smime.p7s
Description: Signature cryptographique S/MIME
-
[sympa-developpers] Sympa and croak,
David Verdin, 12/07/2012
- Re: [sympa-developpers] Sympa and croak, Guillaume Rousse, 12/07/2012
-
Re: [sympa-developpers] Sympa and croak,
IKEDA Soji, 12/07/2012
-
Re: [sympa-developpers] Sympa and croak,
Guillaume Rousse, 12/07/2012
- Re: [sympa-developpers] Sympa and croak, David Verdin, 12/11/2012
-
Re: [sympa-developpers] Sympa and croak,
Guillaume Rousse, 12/07/2012
Archive powered by MHonArc 2.6.19+.