R
Rahul
Hi Everyone,
I'm currently developing a class for a database, each object of the
class will establish a connection to the database on a remote server
and and all of this happens on the constructor. So there are cases
when the connection can fail during the initial setup in the
constructor and i was wondering how to send this error to the caller.
Is it a good design to throw exceptions from the constructor? or is
there any other alternative?
Thanks in advance ! ! !
I'm currently developing a class for a database, each object of the
class will establish a connection to the database on a remote server
and and all of this happens on the constructor. So there are cases
when the connection can fail during the initial setup in the
constructor and i was wondering how to send this error to the caller.
Is it a good design to throw exceptions from the constructor? or is
there any other alternative?
Thanks in advance ! ! !