Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def leaderboardPost(name: Option[String]): Route =
- post {
- logRequest("leaderboard", Logging.DebugLevel) {
- handleRejections(postBodyRejections) {
- entity(as[LeaderboardPostRequest]) { leaderboard =>
- try {
- complete(leaderboardCreate(Some(leaderboard.name), Some(leaderboard.kind)))
- } catch {
- case cause: DuplicateIDException =>
- logger.error(cause)
- complete(cause.response)
- case cause: UnknownKindException =>
- logger.warn(cause)
- complete(cause.response)
- case cause: Throwable =>
- logger.error(cause)
- complete(HttpResponse(InternalServerError, entity = s"Exception thrown from LeaderboardPost: ${cause.getMessage}"))
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment