Q: Exception design questions

eao197 eao197 at intervale.ru
Sat Jun 16 00:06:58 PDT 2007


On Sat, 16 Jun 2007 06:32:02 +0400, Myron Alexander  
<someone at somewhere.com> wrote:

> And this is how I use it:
>
>> (new SqlProgrammingException (
>>    "Invalid bind type. Mixing single and multiple value rows. "
>>    "The first argument type is other than Box[], thus it is "
>>    "assumed that the rest of the arguments are single value "
>>    "rows."))
>> .setSql (operation)
>> .setProperty ("ValueRow", i)
>> .setProperty ("ValueType", t)
>> .raise ();

IMHO, the following variant is more preferable for me, because I can  
easily find all places where an exception is thrown simply by `grep throw`  
(and `throw` keywords is highlighted in editors):

throw ((new SqlProgrammingException (
     "Invalid bind type. Mixing single and multiple value rows. "
     "The first argument type is other than Box[], thus it is "
     "assumed that the rest of the arguments are single value "
     "rows."))
     .setSql (operation)
     .setProperty ("ValueRow", i)
     .setProperty ("ValueType", t));

-- 
Regards,
Yauheni Akhotnikau



More information about the Digitalmars-d mailing list