Am I using a try-catch block correctly?
The saying goes “exceptions are exceptional”. I would say connecting to a database is crucial and without it my program cannot function. Therefore makes sense to throw an exception on failure to connect.
The saying goes “exceptions are exceptional”. I would say connecting to a database is crucial and without it my program cannot function. Therefore makes sense to throw an exception on failure to connect.