Browse Source

Default implementation for getMessage

杨博 (Yang Bo) 10 years ago
parent
commit
fe3460e586
1 changed files with 9 additions and 0 deletions
  1. 9 0
      std/java/internal/Exceptions.hx

+ 9 - 0
std/java/internal/Exceptions.hx

@@ -73,6 +73,15 @@ class Exceptions {
 	{
 		return "Haxe Exception: " + obj;
 	}
+	
+	override public function getMessage():String
+	{
+		return switch (super.getMessage())
+		{
+			case null: Std.string(obj);
+			case message: message;
+		}
+	}
 
 	public static function wrap(obj:Dynamic):RuntimeException
 	{