Pārlūkot izejas kodu

[php] _hx_exception_handler should exit with non-0 code and write error to stderr

http://php.net/manual/en/function.die.php#93061
Andy Li 9 gadi atpakaļ
vecāks
revīzija
1687918c60
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      std/php/Boot.hx

+ 3 - 2
std/php/Boot.hx

@@ -344,9 +344,10 @@ function _hx_exception_handler($e) {
 		$i = $GLOBALS['%s']->length;
 		while(--$i >= 0)
 			$stack .= 'Called from '.$GLOBALS['%s'][$i].$nl;
-		die($pre.'uncaught exception: '.$msg.$nl.$nl.$stack.$post);
+		fwrite(STDERR, $pre.'uncaught exception: '.$msg.$nl.$nl.$stack.$post.'\n');
 	} else
-		die($pre.'uncaught exception: '.$msg.$nl.$nl.'in file: '.$e->getFile().' line '.$e->getLine().$nl.$e->getTraceAsString().$post);
+		fwrite(STDERR, $pre.'uncaught exception: '.$msg.$nl.$nl.'in file: '.$e->getFile().' line '.$e->getLine().$nl.$e->getTraceAsString().$post.'\n');
+	exit(1);
 }
 
 function _hx_explode($delimiter, $s) {