From d733294cb16fa83be014ce1efccbf364aa309d25 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Fri, 14 Jul 2017 15:05:12 -0700 Subject: Fix PR --- .../scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala index 2556feb..f59836e 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala @@ -37,7 +37,11 @@ final case class ApiTrial(id: String, previousAssignee = this.previousAssignee.map(id => StringId(id)), lastActiveUserId = this.lastActiveUser.map(id => StringId(id)), lastUpdate = this.lastUpdate.toLocalDateTime(), - condition = Trial.Condition.fromString(this.condition), + condition = Trial.Condition + .fromString(this.condition) + .getOrElse( + throw new NoSuchElementException(s"unknown condition ${this.condition}") + ), phase = this.phase, hypothesisId = this.hypothesisId.map(id => UuidId(id)), studyDesignId = this.studyDesignId.map(id => LongId(id)), -- cgit v1.2.3