summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-08-31 11:57:55 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-08-31 11:57:55 +0000
commit6b3f18dbddb0292d2bd7e10a4e508e34921b09a6 (patch)
tree46fdb049eeb16293ef49623d3fb0208dcc7bb960
parent3ee45986dc06b1d5f7169e3cde4b953814a68b97 (diff)
downloadscala-6b3f18dbddb0292d2bd7e10a4e508e34921b09a6.tar.gz
scala-6b3f18dbddb0292d2bd7e10a4e508e34921b09a6.tar.bz2
scala-6b3f18dbddb0292d2bd7e10a4e508e34921b09a6.zip
Forgot to catch NumberFormatExceptions in IntSe...
Forgot to catch NumberFormatExceptions in IntSetting.
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 7cbc77a7c9..83e202d2e1 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -294,9 +294,11 @@ class Settings(error: String => Unit) {
protected var v: Int = default
+ def errorMsg = error("invalid setting for -"+name+" "+validText)
+
def value: Int = this.v
def value_=(s: Int) {
- if(!valid(s)) error("invalid setting for -"+name+" "+validText)
+ if(!valid(s)) errorMsg
setByUser = true;
this.v = s
}
@@ -307,7 +309,11 @@ class Settings(error: String => Unit) {
error("missing argument")
args
} else {
- value = rest.head.toInt
+ try {
+ value = rest.head.toInt
+ } catch {
+ case (e: java.lang.NumberFormatException) => errorMsg
+ }
rest.tail
}
case _ => args