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

Commit 895f22f

Browse files
committed
Let the Mapparameter throw an exception if no regex is matched
1 parent 692858d commit 895f22f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MapParameterImpl extends MapParameter {
2222
val kvpair = "\\((.+);(.+)\\)".r
2323
val konly = "\\((.+);\\)".r
2424
this.value = value.split(",")
25-
.map({ case kvpair(k, v) => (k -> v); case konly(k) => (k -> ""); case _ => ("" -> "") })
25+
.map({ case kvpair(k, v) => (k -> v); case konly(k) => (k -> ""); case _ => throw new IllegalArgumentException("Could not convert String to Map")})
2626
.toMap
2727
}
2828

0 commit comments

Comments
 (0)