Closed acco closed 2 years ago
I would love to see a PR exploring this and we can decide based on that if it is not too much work.
Ok @josevalim ! I'll see what I can whip up
@josevalim Would love any feedback you have on a PR I put together. Thank you in advance.
Per https://github.com/elixir-ecto/db_connection/pull/264#issuecomment-1161358040, think it makes the most sense to just funnel all calls to Postgrex.query
into one location in our app and rescue the exception. Thanks all!
Hey team,
DbConnection.ConnectionError
s happen. We obviously have worked to minimize, but there are some high-volume tables in our app that will run into this issue from time to time.The problem is that unlike other errors, a
ConnectionError
is an exception. This complicates our control flow: instead of being able to use a with clause to handle all the possible things that can go wrong, we have to do some extra try/rescue wrapping to handle these exceptions.Is there any appetite for making this behavior configurable? Or am I missing something here? It would be great to have a
start_link/1
setting that flipped connection errors to a tuple instead of an exception. With some guidance, I'd be happy to help make it happen.