@@ -61,12 +61,12 @@ defmodule Mix.Tasks.Deps.Partition do
61
61
% { port: port , index: index , socket: client }
62
62
63
63
error ->
64
- raise """
64
+ Mix . raise ( """
65
65
could not start partition dependency compiler, no connection made to TCP port: #{ inspect ( error ) }
66
66
67
67
The spawned operating system process wrote the following output:
68
68
#{ close_port ( port , "" ) }
69
- """
69
+ """ )
70
70
end
71
71
end )
72
72
@@ -117,14 +117,11 @@ defmodule Mix.Tasks.Deps.Partition do
117
117
118
118
{ :tcp_closed , socket } ->
119
119
shutdown_clients ( available ++ busy )
120
- Mix . shell ( ) . error ( "ERROR! mix deps.partition #{ inspect ( socket ) } closed unexpectedly" )
120
+ Mix . raise ( "ERROR! mix deps.partition #{ inspect ( socket ) } closed unexpectedly" )
121
121
122
122
{ :tcp_error , socket , error } ->
123
123
shutdown_clients ( available ++ busy )
124
-
125
- Mix . shell ( ) . error (
126
- "ERROR! mix deps.partition #{ inspect ( socket ) } errored: #{ inspect ( error ) } "
127
- )
124
+ Mix . raise ( "ERROR! mix deps.partition #{ inspect ( socket ) } errored: #{ inspect ( error ) } " )
128
125
129
126
{ port , { :data , { eol , data } } } ->
130
127
with % { index: index } <-
@@ -186,8 +183,12 @@ defmodule Mix.Tasks.Deps.Partition do
186
183
{ :ok , socket } =
187
184
:gen_tcp . connect ( String . to_charlist ( host ) , port , [ :binary , packet: :line , active: false ] )
188
185
189
- deps = Mix.Dep . load_and_cache ( )
190
- client_loop ( socket , deps , force? , Mix.Project . deps_config ( ) )
186
+ try do
187
+ deps = Mix.Dep . load_and_cache ( )
188
+ client_loop ( socket , deps , force? , Mix.Project . deps_config ( ) )
189
+ after
190
+ :gen_tcp . close ( socket )
191
+ end
191
192
end
192
193
193
194
def client_loop ( socket , deps , force? , config ) do
0 commit comments