Closed fishcakez closed 8 years ago
Note for future: this will require handling result of {kind, reason, stack}
in Ecto.LogEntry
It looks good to me but we need to be careful with not breaking current Ecto versions as soon as we release this.
@josevalim: Shall we solve this by rewriting {kind, class, stack}
as {:error, %DBConnection.ConnectionError{}}
when logging for now?
I have added the close on raising in describe/encode - we need this for https://github.com/elixir-ecto/postgrex/issues/219.
@fishcakez that would probably be better, yes.
@josevalim ok tests have been added.
With prepare_execute
we now close the query on describe exception. Should we do the same for prepare
? I think we have to for consistency and because the query did not finish preparing . This means a slower checkin if just doing a prepare but that situation is rare - usually inside a transaction.
With prepare_execute we now close the query on describe exception. Should we do the same for prepare? I think we have to for consistency and because the query did not finish preparing . This means a slower checkin if just doing a prepare but that situation is rare - usually inside a transaction.
Sounds like the way to go indeed.
This adds some major changes in error handling so requires tests plus review. I plan to add a commit which does more error handling in
prepare_execute
(closes prepared query if describe or encode raises).