-
Notifications
You must be signed in to change notification settings - Fork 115
Put a label (like 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
| 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 |
7b008da to
66bd0ec
Compare
The label must be passed in - see elixir-ecto/ecto_sql#698 Assuming it's the repo name, 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"
66bd0ec to
2665095
Compare
|
Updated so that callers can optionally pass a 11:21:51.330 [error] Process #PID<0.1502.0> raised an exception
** (DBConnection.OwnershipError) cannot find ownership process for #PID<0.1502.0> (:erlang)
(GridPoint.Repo) using mode :manual.
(Note that a connection's mode reverts to :manual if its owner
terminates.) |
|
@josevalim what do you think of this approach? |
The label must be passed in - see elixir-ecto/ecto_sql#698
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