aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/tasks
diff options
context:
space:
mode:
authorJay Hayes <ur@iamvery.com>2015-04-26 22:21:54 -0500
committerJay Hayes <ur@iamvery.com>2015-10-20 19:17:58 -0500
commitc2e597a7362fd0b497da7c622717406bb70cd360 (patch)
tree4023a1bc02296e0b82cde8676adabcb727fc5e86 /activerecord/lib/active_record/tasks
parent2893e6c0a459a91a033d357cd15cc4d14e7acbc1 (diff)
downloadrails-c2e597a7362fd0b497da7c622717406bb70cd360.tar.gz
rails-c2e597a7362fd0b497da7c622717406bb70cd360.tar.bz2
rails-c2e597a7362fd0b497da7c622717406bb70cd360.zip
Exit with non-zero status when db:drop fails
* If the drop task fails for a reason other than the database not existing, processing should end. This is indicated by a non-zero exit status. * Since the backtrace is already printed to screen, we forgo printing it again by using an explicit call to `exit`. * :warning: This modifies the behavior of the db:create task slightly in that the stack trace is no longer printed by default. If the `--trace` option is used, it will print the trace _after_ the error message.
Diffstat (limited to 'activerecord/lib/active_record/tasks')
-rw-r--r--activerecord/lib/active_record/tasks/database_tasks.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb
index f243bf4bfc..c0c29a618c 100644
--- a/activerecord/lib/active_record/tasks/database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/database_tasks.rb
@@ -116,8 +116,9 @@ module ActiveRecord
rescue ActiveRecord::NoDatabaseError
$stderr.puts "Database '#{configuration['database']}' does not exist"
rescue Exception => error
- $stderr.puts error, *(error.backtrace)
+ $stderr.puts error
$stderr.puts "Couldn't drop #{configuration['database']}"
+ raise
end
def drop_all