Closed hzamani closed 7 years ago
The bang and non bang variants are for exceptions returned by a connection, rather than by pool.
In Postgrex's case it will raise some of the connection exceptions on non bang. Only errors from postgres are not raised when no bang, e.g. constraint error. This occurs because postgres errors likely fit into business logic but others do not, so likely do not want to handle in same place.
On 12 Feb 2017 6:50 am, "Hassan Zamani" notifications@github.com wrote:
Are DBConnection.prepare/3 and DBConnection.execute/4 expected to raise errors? If this is the case then why there are prepare!/3 and execute!/4 functions there?
— 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/77, or mute the thread https://github.com/notifications/unsubscribe-auth/AB6JTU3u3wJMtJZquHFPcPyCiRIbWr64ks5rbqu2gaJpZM4L-aVO .
The pool exceptions are now returned on master: https://github.com/elixir-ecto/db_connection/commit/53271f7d2636bafca3966bbee44d0ecf70d10064.
Are
DBConnection.prepare/3
andDBConnection.execute/4
expected to raise errors? If this is the case then why there areprepare!/3
andexecute!/4
functions there?