mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Allow notification templates to fail
Templates were hardcoded. To make them dynamic, errors must be handled.
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user