From b4f718a459490909e673e72bf6e3d0fec1901465 Mon Sep 17 00:00:00 2001 From: odersky Date: Mon, 31 Oct 2011 14:56:56 +0000 Subject: [PATCH] Code to locate currently transformed unit in case of crashes. Review by extempore. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25914 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- src/compiler/scala/tools/nsc/ast/Trees.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index b9f808c25..7c97b9f3d 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -201,7 +201,14 @@ trait Trees extends reflect.internal.Trees { self: Global => } class Transformer extends super.Transformer { - def transformUnit(unit: CompilationUnit) { unit.body = transform(unit.body) } + def transformUnit(unit: CompilationUnit) { + try unit.body = transform(unit.body) + catch { + case ex: Exception => + println("unhandled exception while transforming "+unit) + throw ex + } + } } override protected def xtransform(transformer: super.Transformer, tree: Tree): Tree = tree match {