robotpony / Presto

Simple tools for building RESTfull interfaces. This is an old and unmaintained project.
http://presto.napkinware.ca
Other
11 stars 3 forks source link

Allow existing singleton function to be called w/o credentials to return... #100

Closed adam-patterson closed 10 years ago

adam-patterson commented 10 years ago

... existing instance

@robotpony

ghost commented 10 years ago

Looks good once exception is moved here.

adam-patterson commented 10 years ago

Any exception caused by a failed connection attempt is already handled in the _instance function. The call to the constructor will throw a PDOException if the attempt to connect to the requested database fails. This is then caught and rethrown wrapped in our own exception.

In the case where the instance is null when the function is called, it would just make the connection.

I will change the exception throwing in the two core classes to use asserts instead.

ghost commented 10 years ago

:+1: