Browse Source

Merge pull request #3313 from qifun/haxe-exception-message

[cs] Show exception details in debugger output
Cauê Waneck 11 years ago
parent
commit
6d8ada7b0b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      std/cs/internal/Exceptions.hx

+ 3 - 2
std/cs/internal/Exceptions.hx

@@ -30,6 +30,7 @@ import cs.system.Exception;
 }
 }
 
 
 //should NOT be usable inside haxe code
 //should NOT be usable inside haxe code
+@:classCode('override public string Message{ get{ return this.toString(); } }')
 @:nativeGen @:keep @:native("haxe.lang.HaxeException") private class HaxeException extends Exception
 @:nativeGen @:keep @:native("haxe.lang.HaxeException") private class HaxeException extends Exception
 {
 {
 	private var obj:Dynamic;
 	private var obj:Dynamic;
@@ -53,7 +54,7 @@ import cs.system.Exception;
 
 
 	public function toString():String
 	public function toString():String
 	{
 	{
-		return "Haxe Exception: " + obj;
+		return Std.string(obj);
 	}
 	}
 
 
 	public static function wrap(obj:Dynamic):Exception
 	public static function wrap(obj:Dynamic):Exception
@@ -62,4 +63,4 @@ import cs.system.Exception;
 
 
 		return new HaxeException(obj);
 		return new HaxeException(obj);
 	}
 	}
-}
+}