elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

Connection not available because of disconnection #59

Closed azranel closed 7 years ago

azranel commented 7 years ago

Hey

Just had problem with PostgreSQL not running correctly in the background. Error I got was the same as in title which to be honest wasn't really easy to understand. Maybe it would be good to change this message a little?

From what I see this message is used in two places in this repo

Message could include possible solutions ("check if database is working" for example).

Cheers

fishcakez commented 7 years ago

We can definitely improve the message

On 24 September 2016 at 15:30, Bartosz Łęcki notifications@github.com wrote:

Hey

Just had problem with PostgreSQL not running correctly in the background. Error I got was the same as in title which to be honest wasn't really easy to understand. Maybe it would be good to change this message a little?

From what I see this message is used in two places in this repo https://github.com/elixir-ecto/db_connection/search?utf8=%E2%9C%93&q=Connection+not+available+because+of+disconnection

Cheers

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elixir-ecto/db_connection/issues/59, or mute the thread https://github.com/notifications/unsubscribe-auth/AB6JTdk3RIbf_7C5_9nByu1czqRrudTXks5qtTQcgaJpZM4KFp7T .

fishcakez commented 7 years ago

It is difficult because we do not know why the error occurred, only that the process is not connected to the database at that moment. I would like to keep the message as short as possible because this exception could happen a lot at once. For example it may not be true that the process is unable to connect, just that something caused a disconnection, such as process of the previous checkout getting shutdown while holding the socket.

azranel commented 7 years ago

Maybe then something like Connection failed. Could not connect or disconnected would be better? It says that either that it could not initialize connection at all or connection has been lost because of disconnection.

fishcakez commented 7 years ago

connection not available because not connected? The double negative is awkward. I would like to keep "connection not available" at the beginning of the message for consistency so will leave the message as but welcome a PR to improve it with a clearer one if someone would like.