File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -141,23 +141,31 @@ 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 ))
154
158
else None
155
159
(None , exit)
156
- case _ : ServerAlreadyBootingException =>
160
+ case e : ServerAlreadyBootingException =>
157
161
if (SysProp .forceServerStart) (None , None )
158
- else (None , Some (Exit (2 )))
162
+ else {
163
+ printThrowable(e)
164
+ (None , Some (Exit (2 )))
165
+ }
159
166
case _ : UnsatisfiedLinkError => (None , None )
160
167
}
168
+ }
161
169
}
162
170
163
171
final class ScriptMain extends xsbti.AppMain {
You can’t perform that action at this time.
0 commit comments