lib/hanami/model/migrator/postgres_adapter.rb in hanami-model-1.3.0 vs lib/hanami/model/migrator/postgres_adapter.rb in hanami-model-1.3.1
- old
+ new
@@ -94,12 +94,10 @@
def call_db_command(command)
require 'open3'
begin
Open3.popen3(command, database) do |_stdin, _stdout, stderr, wait_thr|
- unless wait_thr.value.success? # wait_thr.value is the exit status
- raise MigrationError.new(modified_message(stderr.read))
- end
+ raise MigrationError.new(modified_message(stderr.read)) unless wait_thr.value.success? # wait_thr.value is the exit status
end
rescue SystemCallError => e
raise MigrationError.new(modified_message(e.message))
end
end