From e4db7e05023d66a42bddcd0d194cf239971de9d4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 20 Jul 2012 16:21:00 +0200 Subject: address "this would catch all throwables" warnings original patch by @odersky in #955 -- criterion for the refactor: "catch Throwable as long as there's no obvious control flow exception going through the catch and the caught exception is processed further" rebased & updated with review comments in #955 and #954 --- src/compiler/scala/tools/util/VerifyClass.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler/scala/tools/util') diff --git a/src/compiler/scala/tools/util/VerifyClass.scala b/src/compiler/scala/tools/util/VerifyClass.scala index 5f636f63fb..e0e089d0b2 100644 --- a/src/compiler/scala/tools/util/VerifyClass.scala +++ b/src/compiler/scala/tools/util/VerifyClass.scala @@ -13,7 +13,8 @@ object VerifyClass { Class.forName(name, true, cl) (name, None) } catch { - case x => (name, Some(x.toString)) + case x: Throwable => // TODO: only catch VerifyError (and related) + ExceptionInInitializationError (for static objects that bomb on classload) + (name, Some(x.toString)) } } -- cgit v1.2.3