Skip to content

Commit 8eccfb3

Browse files
committed
Print error message in case of errors
1 parent 4df06f9 commit 8eccfb3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

core/loop.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ object EventLoop extends ExecutionContextExecutor {
4444
// Schedule loop execution after main ends
4545
scalanative.runtime.ExecutionContext.global.execute(
4646
new Runnable {
47-
def run(): Unit = EventLoop.run()
47+
def run(): Unit = {
48+
val returnCode = EventLoop.run()
49+
if(returnCode != 0) {
50+
Zone { implicit z =>
51+
System.err.println(fromCString(uv_err_name(returnCode)))
52+
}
53+
System.exit(returnCode)
54+
}
55+
}
4856
}
4957
)
5058

@@ -57,11 +65,12 @@ object EventLoop extends ExecutionContextExecutor {
5765
t.printStackTrace()
5866
}
5967

60-
def run(mode:Int = UV_RUN_DEFAULT):Unit = {
68+
def run(mode:Int = UV_RUN_DEFAULT):Int = {
6169
var continue = 1
6270
while (continue != 0) {
6371
continue = uv_run(loop, mode)
6472
}
73+
continue
6574
}
6675
}
6776

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.4
1+
sbt.version=1.3.4

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2")
22
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
3-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
3+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")

0 commit comments

Comments
 (0)