FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Standard Exceptions

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
Sue D. Nymme



Joined: 26 Jul 2006
Posts: 13
Location: Philadelphia, PA, USA

PostPosted: Wed Jul 26, 2006 8:30 am    Post subject: Standard Exceptions Reply with quote

Is there an existing hierarchy for standard exception classes? By "standard", I mean "exceptions that most every class programmer will need to throw from time to time." For example, exceptions dealing with function/method arguments, object state, and so on. I find myself writing the same sorts of exceptions over and over again, and it seems to me that it'd be easier to write code, and handle exceptions in other classes, if there's a standard hierarchy that everyone is comfortable using.

I am thinking that the following sorts of exceptions would fall into this category:

  • Argument Error

    • Wrong number of arguments

      • Too many arguments
      • Too few arguments

    • Argument out of bounds

      • Argument too large
      • Argument too small

    • Wrong type of argument
    • Nonsensical combination of arguments

  • Class Version error

    • Feature is not implemented yet
    • Feature is obsolete

  • Object state errors

    • Object is in an inconsistent state
    • Method not applicable to object's current state
    • Argument not applicable to object's current state

and so on.

Operating system errors ("File not found", "Device busy", "Insufficient privileges", etc) would not fall into this general-purpose category, I think, because they should be defined by the module(s) that interface with the system (std.stream, std.stdio, etc).

Comments?
_________________
"If anyone finds the above offensive, I am prepared not only to retract it, but also to deny under oath that I ever said it." -- Tom Lehrer
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Wed Jul 26, 2006 8:47 am    Post subject: Reply with quote

I've thought about this a bit in the past for Ares but couldn't settle on a heirarchy I was completely happy with. But if you have any suggestions, feel free to post them in the Ares forum. I've been a bit busy with side-projects recently, but I plan to get to everything eventually Smile
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Wed Jul 26, 2006 8:54 am    Post subject: Reply with quote

This is OT, but Sue needs to advise on what I do with this message from her mail server:

Code:

This is the Postfix program at host dsource1.dsource.org.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

         The Postfix program

<sdn.dlang@zoemail.net>: host mail.zoemail.net[64.74.53.233] said: 550 Please
    visit http://www.zoemail.net/?sdn to obtain a spam-protected ZoEmail keyed
    address to contact the user. (in reply to RCPT TO command)



Reporting-MTA: dns; dsource1.dsource.org
X-Postfix-Queue-ID: 3272D53D8B
X-Postfix-Sender: rfc822; admin@dsource.org
Arrival-Date: Wed, 26 Jul 2006 09:47:21 -0500 (CDT)

Final-Recipient: rfc822; sdn.dlang@zoemail.net
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host mail.zoemail.net[64.74.53.233] said: 550
    Please visit http://www.zoemail.net/?sdn to obtain a spam-protected ZoEmail
    keyed address to contact the user. (in reply to RCPT TO command)



Subject:
Topic Reply Notification - Standard Exceptions
From:
admin@dsource.org
Date:
Wed, 26 Jul 2006 09:47:19 -0500
To:
Undisclosed-recipients:;

Hello,

You are receiving this email because you are watching the topic, "Standard Exceptions" at . This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.

http://www.dsource.org/forums/viewtopic.php?p=10339#10339

If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link:

http://www.dsource.org/forums/viewtopic.php?t=1726&unwatch=topic

-- Thanks, The Management


Thanks,
BA
Back to top
View user's profile Send private message
Sue D. Nymme



Joined: 26 Jul 2006
Posts: 13
Location: Philadelphia, PA, USA

PostPosted: Wed Jul 26, 2006 9:21 am    Post subject: Reply with quote

brad wrote:
This is OT, but Sue needs to advise on what I do with this message from her mail server:


Ah, oops. That's my fault -- I forgot to add that sub-address to my account at zoemail.org. It is now valid, and my apologies.
_________________
"If anyone finds the above offensive, I am prepared not only to retract it, but also to deny under oath that I ever said it." -- Tom Lehrer
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Wed Jul 26, 2006 9:33 am    Post subject: Reply with quote

well, you already had sdn.dlang but it may be admin@dsource.org that is sending the notifications that's the issue.

I went to the site and got sdn.lawful21064@zoemail.net if you want to use that. I just don't want to have to do this for every user, if ZoEmail catches on...

BA
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group