Meaningful info on PG::ActiveSqlTransaction error [WIP] #13809

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

lukesarnacki commented Jan 23, 2014

Currently when performing sql queries that cannot be run in transaction in migrations, like create index concurrently in postgresql, error message is not very meaningful. This is my try on adding better hint to make life of RoR newbies little bit easier.

This is marked as WIP for 2 reasons:

  1. This is postgresql only so far.
  2. I am not sure about design of this solution. I tried to do it in cleaner way, but this is what I came up with so far.

I would appreciate any help on this ❤️.

Currently this looks like:
active-sql-transaction

Meaningful info on PG::ActiveSqlTransaction error [WIP]
This commit puts information about disable_ddl_transaction! method
when PG::ActiveSqlTransaction expception is raised while running
migrations.

@matthewd matthewd added the PostgreSQL label Apr 19, 2014

Owner

matthewd commented Apr 19, 2014

👎

I'm certainly in favour of raising a more specific exception... but if we want to provide migrations-specific advice on how to handle it, I think we should either be wrapping it, or just injecting extra info into the existing exception's message.

This blind puts seems out of place, even before we introduce ANSI escapes.

Contributor

lukesarnacki commented May 7, 2014

@matthewd thanks for the comment! The problem is I couldn't figure out, how to inject this and I need help with this - this is rather basic concept then intended implementation.

As far as I remember architecture of exceptions handling in adapters makes it really hard or even impossible to write this easily (at least from what I have found).

@matthewd do you have any suggestions on this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment