Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Config] Database Connection Silently Fails #12

Closed
richardklint opened this issue Mar 14, 2019 · 2 comments
Closed

[Config] Database Connection Silently Fails #12

richardklint opened this issue Mar 14, 2019 · 2 comments
Assignees
Labels
bug Fixed Fixed bug

Comments

@richardklint
Copy link

richardklint commented Mar 14, 2019

Steps

Simply setup a project with a database name that doesn't exist.

Expected Result

An exception be thrown.

Actual Result

A message gets echo'ed and program continues. (See \Ubiquity\db\Database::connect)

Versions

  • Ubiquity: 2.0.11
  • PHP: 7.1.27
  • OS: Ubuntu 18.04
@jcheron
Copy link
Contributor

jcheron commented Mar 14, 2019

Indeed, it is not very professional
A DBException would be more appropriate

@jcheron
Copy link
Contributor

jcheron commented Mar 15, 2019

I know now why I did that:
The connection to the database is called very early in the services.php file.

If I generate an exception for the DB connection, it is no longer possible to access the administration part, which is problematic to correct the error, or to visualize the logs.

I will fix and throw an exception in the connect method of DataBase.
It will now be necessary to do a try/catch on the connection in services.php

jcheron added a commit that referenced this issue Mar 15, 2019
jcheron added a commit that referenced this issue Mar 15, 2019
jcheron added a commit to phpMv/ubiquity-devtools that referenced this issue Mar 15, 2019
@jcheron jcheron added the Fixed Fixed bug label Apr 2, 2019
@jcheron jcheron closed this as completed Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixed Fixed bug
Projects
None yet
Development

No branches or pull requests

2 participants