Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fail on error, assertion , uncaught exception

  • Loading branch information...
commit e798b2ba0ee6d3fc401c27369bd1299bc0ff56bc 1 parent a2cad5b
Ritchie Turner authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 cloudshift/Core.hx
12 cloudshift/Core.hx
View
@@ -104,8 +104,8 @@ class Core {
Sys.events().observe(function(e) {
switch(e) {
case ProcessUncaughtException(exc):
- trace(exc);
- trace(haxe.Stack.exceptionStack());
+ Core.error("Uncaught exception: "+exc);
+ Sys.exit(1);
case ProcessExit:
case SigInt(sig):
}
@@ -210,7 +210,7 @@ class Core {
}
public static
- function waitFor(toJoin:Array<Future<Dynamic>>):Future<Array<Dynamic>> {
+ function waitFut(toJoin:Array<Future<Dynamic>>):Future<Array<Dynamic>> {
var
count = toJoin.length,
fut = Core.future();
@@ -243,8 +243,12 @@ class Core {
public static function
assert( cond : Bool, ?pos : haxe.PosInfos ) {
- if( !cond )
+ if( !cond ) {
Core.error("Assert failed in "+pos.className+"::"+pos.methodName,pos);
+ #if nodejs
+ Sys.exit(1);
+ #end
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.