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

Comments

Projects
None yet
1 participant
@ferventcoder
Member

ferventcoder commented Jul 9, 2012

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

This comment has been minimized.

Show comment
Hide comment
@ferventcoder

ferventcoder Sep 7, 2012

Member

Fixed in 3902f16

Member

ferventcoder commented Sep 7, 2012

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

ChrisMissal pushed a commit to ChrisMissal/roundhouse that referenced this issue Jul 30, 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