From 53e029d3a304d1be92acb828d5b95e19839b7a5a Mon Sep 17 00:00:00 2001 From: ferventcoder Date: Fri, 7 Sep 2012 06:35:07 +0000 Subject: [PATCH] Log statement being run when an error occurs - https://github.com/chucknorris/roundhouse/issues/66 --- product/roundhouse/migrators/DefaultDatabaseMigrator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/product/roundhouse/migrators/DefaultDatabaseMigrator.cs b/product/roundhouse/migrators/DefaultDatabaseMigrator.cs index 25ba520..d2bc067 100644 --- a/product/roundhouse/migrators/DefaultDatabaseMigrator.cs +++ b/product/roundhouse/migrators/DefaultDatabaseMigrator.cs @@ -189,7 +189,9 @@ public bool run_sql(string sql_to_run, string script_name, bool run_this_script_ } catch (Exception ex) { + Log.bound_to(this).log_an_error_event_containing("Error executing file '{0}': statement running was '{1}'", script_name, sql_statement); database.rollback(); + record_script_in_scripts_run_errors_table(script_name, sql_to_run, sql_statement, ex.Message, repository_version, repository_path); database.close_connection(); throw;