B
Brian C
Hello all,
I read through the C++ FAQ and I think I'm good here. I'm posting to
see if there may be other ways that I'm not thinking of.
What I've got is a cross-platform library I've developed, and use to
develop applications on both Linux, AIX & Windows. Now, some things I
have in there are my own exceptions. One exception I have is a
"ConnectionFailed" exception which currently extends a
"NetworkException". This way I can catch just a NetworkException when I
don't care what kind of network exception occurred.
I'm adding a MySQL wrapper class, and of course you need to connect
into the database. I wanted to use the same "ConnectionFailed" exception
instead of making a "DatabaseConnectionFailed" exception (or the like).
So, I created a generic "DatabaseException" and had ConnectionFailed
extend both the Network & DatabaseException classes.
Is this an accepted method? If so/if not, anyone got any other ideas?
Again, I don't want to make seperate "SocketConnectionFailedException"
and "DatabaseConnectionFailedException" classes.
Thanks.
I read through the C++ FAQ and I think I'm good here. I'm posting to
see if there may be other ways that I'm not thinking of.
What I've got is a cross-platform library I've developed, and use to
develop applications on both Linux, AIX & Windows. Now, some things I
have in there are my own exceptions. One exception I have is a
"ConnectionFailed" exception which currently extends a
"NetworkException". This way I can catch just a NetworkException when I
don't care what kind of network exception occurred.
I'm adding a MySQL wrapper class, and of course you need to connect
into the database. I wanted to use the same "ConnectionFailed" exception
instead of making a "DatabaseConnectionFailed" exception (or the like).
So, I created a generic "DatabaseException" and had ConnectionFailed
extend both the Network & DatabaseException classes.
Is this an accepted method? If so/if not, anyone got any other ideas?
Again, I don't want to make seperate "SocketConnectionFailedException"
and "DatabaseConnectionFailedException" classes.
Thanks.