Allow notification templates to fail

Templates were hardcoded. To make them dynamic, errors must be handled.
This commit is contained in:
eikek
2022-01-11 21:49:39 +01:00
parent 42d631876d
commit dd9937740a
14 changed files with 165 additions and 116 deletions

View File

@ -162,7 +162,11 @@ object NotificationRoutes {
user.account,
baseUrl.some
)
resp <- Ok(data.asJsonWithMessage)
resp <- data.asJsonWithMessage match {
case Right(m) => Ok(m)
case Left(err) =>
BadRequest(BasicResult(false, s"Unable to render message: $err"))
}
} yield resp
}
}