@open class Error(msg: String): Throwable(msg) { @override fun printStackTrace() { if super.getMessage() !== nil { println("Error: " + super.getMessage()); } else { println("Error"); } let x = self.getStackTrace(); var i = 0; while i < x.length() { println(i.toString() + ": " + x.get(i).toString()); i = i + 1; } } }