File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -78,21 +78,31 @@ defmodule Mongo.Migration do
78
78
_other ->
79
79
:noop
80
80
end
81
+ rescue
82
+ e ->
83
+ IO . puts ( "🚨 Error when migrating #{ mod } :" )
84
+ IO . puts ( Exception . format ( :error , e , __STACKTRACE__ ) )
85
+ reraise e , __STACKTRACE__
81
86
end
82
87
83
88
defp run_down ( version , mod ) do
84
89
topology = get_config ( ) [ :topology ]
85
90
collection = get_config ( ) [ :collection ]
86
91
87
92
case Mongo . find_one ( topology , collection , % { version: version } ) do
88
- % { version: _version } ->
93
+ % { " version" => _version } ->
89
94
mod . down ( )
90
95
Mongo . delete_one ( topology , collection , % { version: version } )
91
96
IO . puts ( "💥 Successfully dropped #{ mod } " )
92
97
93
98
_other ->
94
99
:noop
95
100
end
101
+ rescue
102
+ e ->
103
+ IO . puts ( "🚨 Error when dropping #{ mod } :" )
104
+ IO . puts ( Exception . format ( :error , e , __STACKTRACE__ ) )
105
+ reraise e , __STACKTRACE__
96
106
end
97
107
98
108
def get_config ( ) do
You can’t perform that action at this time.
0 commit comments