Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] Using exception

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Guillaume Rousse <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] Using exception
  • Date: Mon, 07 Oct 2013 20:15:19 +0200

Le 07/10/2013 17:55, Guillaume Rousse a écrit :
Hence my point: to be discussed later, once we have a working code base,
on specific use case.
Here is an alternative proposal, a little more positive regarding current topic.

1) select a simple ternal function (for instance Sympa::Tools::File::set_file_rights())
2) replace its current error handling logic with exceptions
3) find every place in Sympa code where this function is called
4) replace every usage of the function to ensure the exception won't propagate further, and the error is properly logged
5) add unit tests checking your modifications
6) iterate

This way, you're setting up your error handling bottom-up, rather than top-down. And if ever you have to refactor it, as you missed something, you have unit tests to check regressions.
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page