Auxiliary constructors in Scala have to invoke another constructor as the first thing they do, see the Scala Language Reference, Section 5.3.1, p. 74 or Scala constructor overload? So, validation of arguments in the way suggested is not possible.
See also Why can auxiliary constructors in Scala only consist of a single call to another constructor? The book "Programming in Scala" by Odersky, Spoon, and Venners sates the following on this topic (Section 6.7, p. 147):
If you’re familiar with Java, you may wonder why Scala’s rules for
constructors are a bit more restrictive than Java’s. In Java, a
constructor must either invoke another constructor of the same class,
or directly invoke a constructor of the superclass, as its first
action. In a Scala class, only the primary constructor can invoke a
superclass constructor. The increased restriction in Scala is really a
design trade-off that needed to be paid in exchange for the greater
conciseness and simplicity of Scala’s constructors compared to Java’s.
Superclasses and the details of how constructor invocation and
inheritance interact will be explained in Chapter 10.
As a solution to your question, you might want to consider factory objects, see, e.g., http://fupeg.blogspot.in/2008/11/scala-constructors.html or http://alvinalexander.com/scala/factory-pattern-in-scala-design-patterns This would lead to something like the following (with a more sophisticated validation, probably):
case class Clazz(foo : String, bar : String)
case class FooBarException(msg: String) extends RuntimeException(msg)
object Clazz {
def apply(fooBar : String) : Clazz =
if (fooBar.count(_ == '-') == 1)
new Clazz(fooBar.split("-")(0), fooBar.split("-")(1))
else
throw new FooBarException("not valid: " + fooBar)
}
object Test extends App {
val c1 = Clazz("foo", "bar")
println(c1)
val c2 = Clazz("foo-bar")
println(c2)
try {
val c3 = Clazz("will throw error")
} catch {
case FooBarException(msg) => println(msg)
}
}