Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 692858d

Browse files
committed
Let the Colorparameter throw an exception if no regex is matched
1 parent 067384b commit 692858d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ColorParameterImpl.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class ColorParameterImpl extends ColorParameter {
4040
case int4(r, g, b, a) => set(new Color(r.toInt, g.toInt, b.toInt, a.toInt))
4141
case float3(r, g, b) => set(new Color(r.toFloat, g.toFloat, b.toFloat))
4242
case float4(r, g, b, a) => set(new Color(r.toFloat, g.toFloat, b.toFloat, a.toFloat))
43+
case _ => throw new IllegalArgumentException("Could not convert String to color")
4344
}
4445

4546
}

0 commit comments

Comments
 (0)