-
Notifications
You must be signed in to change notification settings - Fork 115
Put the repo name in these errors #332
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
base: master
Are you sure you want to change the base?
Conversation
This is helpful if the application has more than one repo (eg read replicas). For example: Before: "** (DBConnection.ConnectionError) connection is closed because of an error, disconnect or timeout" After: "** (DBConnection.ConnectionError) MyApp.Repo connection is closed because of an error, disconnect or timeout"
Retain repo name in the state of DBConnection.Ownership.Manager for the
sake of clearer errors.
Before: `** (DBConnection.OwnershipError) cannot find ownership process
for #PID<0.1128.0> ({Phoenix.LiveView,
MyAppWeb.FooLive, "lv:phx-GHKljxU3bpZfbx9j"})
using mode :manual`
After: `** (DBConnection.OwnershipError) cannot find ownership process
for #PID<0.1128.0> ({Phoenix.LiveView,
MyAppWeb.FooLive, "lv:phx-GHKljxU3bpZfbx9j"})
using mode :manual on repo MyApp.Repo`
| using mode #{inspect(mode)}. | ||
| using mode #{inspect(mode)} on repo #{inspect(repo)}. | ||
| (Note that a connection's mode reverts to :manual if its owner | ||
| terminates.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on line 381
|
Hi @nathanl. I would prefer to not depend on repo, because it is really not a db_connection configuration or concern. Can you find anything on |
|
@josevalim good point, but won't 99% of users pass a repo? In |
|
@nathanl would you consider adding some libary-agnostic metadata(contained e.g. in a kw-list) to the exception a viable option? |
|
@realglebivanov Can you elaborate a bit on what that might look like? |
So, right now |
This is helpful if the application has more than one repo (eg read replicas). For example:
Before:
** (DBConnection.ConnectionError) connection is closed because of an error, disconnect or timeoutAfter:
** (DBConnection.ConnectionError) MyApp.Repo connection is closed because of an error, disconnect or timeoutBefore:
** (DBConnection.OwnershipError) cannot find ownership process for #PID<0.1128.0> ({Phoenix.LiveView, MyAppWeb.FooLive, "lv:phx-GHKljxU3bpZfbx9j"}) using mode :manualAfter:
** (DBConnection.OwnershipError) cannot find ownership process for #PID<0.1128.0> ({Phoenix.LiveView, MyAppWeb.FooLive, "lv:phx-GHKljxU3bpZfbx9j"}) using mode :manual on repo MyApp.Repo