Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Log the SQL command being run when an error occurs #66

Closed
ferventcoder opened this issue Jul 9, 2012 · 1 comment
Closed

Comments

@ferventcoder
Copy link
Member

From: https://groups.google.com/forum/#!msg/chucknorrisframework/oXUSEJvrvz4/Fl4W1rAoJDkJ

I understand that if a sql command fails that the command that caused the failure is logged in: RoundhousE.ScriptsRunErrors, however; it would also be nice to have the sql_statement that caused the failure to be written out to the log file so that it is immediately obvious what caused the failure when the user sends the log files from the installation.

I would propose this simple change in DefaultDatabaseMigrator.run_sql:

                   try
                    {
                        database.run_sql(sql_statement, connection_type);
                    }
                    catch (Exception ex)
                    {
                        Log.bound_to(this).log_an_error_event_containing("Error executing command {0} - {1}", script_name, sql_statement); // please add this line
                        database.rollback();

Does this sound reasonable?

@ferventcoder
Copy link
Member Author

Fixed in 3902f16

GoogleCodeExporter pushed a commit to google-code-export/roundhouse that referenced this issue Mar 13, 2015
@ferventcoder ferventcoder modified the milestone: 0.8.6 Jun 3, 2015
jvopalensky pushed a commit to firmwater/roundhouse that referenced this issue Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant