File tree 1 file changed +10
-6
lines changed 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -141,13 +141,17 @@ private[sbt] object xMain {
141
141
142
142
private def getSocketOrExit (
143
143
configuration : xsbti.AppConfiguration
144
- ): (Option [BootServerSocket ], Option [Exit ]) =
145
- try (Some (new BootServerSocket (configuration)) -> None )
144
+ ): (Option [BootServerSocket ], Option [Exit ]) = {
145
+ def printThrowable (e : Throwable ): Unit = {
146
+ println(" sbt thinks that server is already booting because of this exception:" )
147
+ e.printStackTrace()
148
+ }
149
+
150
+ try Some (new BootServerSocket (configuration)) -> None
146
151
catch {
147
152
case e : ServerAlreadyBootingException
148
153
if System .console != null && ! ITerminal .startedByRemoteClient =>
149
- println(" sbt thinks that server is already booting because of this exception:" )
150
- e.printStackTrace()
154
+ printThrowable(e)
151
155
println(" Create a new server? y/n (default y)" )
152
156
val exit =
153
157
if (ITerminal .get.withRawInput(System .in.read) == 'n' .toInt) Some (Exit (1 ))
@@ -156,12 +160,12 @@ private[sbt] object xMain {
156
160
case e : ServerAlreadyBootingException =>
157
161
if (SysProp .forceServerStart) (None , None )
158
162
else {
159
- println(" Boot server failed to create socket" )
160
- e.printStackTrace()
163
+ printThrowable(e)
161
164
(None , Some (Exit (2 )))
162
165
}
163
166
case _ : UnsatisfiedLinkError => (None , None )
164
167
}
168
+ }
165
169
}
166
170
167
171
final class ScriptMain extends xsbti.AppMain {
You can’t perform that action at this time.
0 commit comments