[phobos] isemail error handling

Jacob Carlborg doob at me.com
Sat Mar 5 02:59:11 PST 2011


Yeah, I guess it's more of a "reason code" than error code. But it feels like going back to C, returning status codes and have to look them up in some kind of table.

-- 
/Jacob Carlborg

On 5 mar 2011, at 00:25, Jesse Phillips wrote:

> Is there a reason to make them exceptions? The whole point is to tell
> you if it is or is not a function. I would not consider it an error
> code more a "reason code" (why it wasn't an email address).
> 
> On Fri, Mar 4, 2011 at 2:12 PM, Jacob Carlborg <doob at me.com> wrote:
>> I've ported the isemail module from PHP to D and I'm now working on adding exceptions instead of error codes. The PHP function takes an error level parameter indicating what kind of error level you want. You can pass in a warning and error level and possible others as well. You can also turn the error handling completely off. If the error handling is turned off the function will only return "true" or "false" indicating if the email address is valid or not.
>> 
>> If the error handling is on the function will return 0 if the email address is valid or otherwise an error code indicating what the error was.
>> 
>> The question I now has is: should we keep these different error levels or should we just have a parameter indicating if the error handling is on or off?
>> 
>> --
>> /Jacob Carlborg
>> 
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>> 
> 
> 
> 
> -- 
> Liberty means responsibility. That is why most men dread it.
>   - George Bernard Shaw
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos



More information about the phobos mailing list