elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

Raise RuntimeError on bad return values #282

Closed whatyouhide closed 1 year ago

whatyouhide commented 1 year ago

As mentioned in #281. cc @wojtekmach, I went with RuntimeError, which I think makes more sense here than ArgumentError.

josevalim commented 1 year ago

On the off chance someone is relying on this, I don’t think this is worth changing, given how minimal it is. :)

whatyouhide commented 1 year ago

How can they be relying on returning bad errors and catching the error that DBConnection raises?

josevalim commented 1 year ago

Isn't this propagated upstream to run/3 as per the previous PR?

whatyouhide commented 1 year ago

Yes, but I mean, you think they're relying on possibly returning bad values (like in Postgrex or something)? I think that would be considered a bug, so they should probably not be catching it?

josevalim commented 1 year ago

I don’t think they are or should be, but this is minor to justify potentially breaking something. That’s all :)