-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ class DummyAuthenticatorService extends AbstractAuthenticatorService[Int] { | |
Future.successful(result) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
examples/simple-app/app/controllers/common/MyJsonController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package controllers.common | ||
|
||
import com.alexitc.playsonify.models.{ErrorId, ServerError} | ||
import com.alexitc.playsonify.models.ServerError | ||
import com.alexitc.playsonify.play.AbstractJsonController | ||
import org.slf4j.LoggerFactory | ||
|
||
abstract class MyJsonController(components: MyJsonControllerComponents) extends AbstractJsonController(components) { | ||
|
||
protected val logger = LoggerFactory.getLogger(this.getClass) | ||
|
||
override protected def onServerError(error: ServerError, errorId: ErrorId): Unit = { | ||
logger.error(s"Unexpected internal error = ${errorId.string}", error.cause) | ||
override protected def onServerError(error: ServerError): Unit = { | ||
error.cause match { | ||
case Some(cause) => | ||
logger.error(s"Unexpected internal error, id = ${error.id.string}, error = $error", cause) | ||
|
||
case None => | ||
logger.error(s"Unexpected internal error, id = ${error.id.string}, error = $error}") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
user.error.alreadyExist=The user already exist | ||
user.error.notFound=The user was not found | ||
user.error.incorrectEmail=The email format is incorrect | ||
|
||
auth.error.invalidToken=The authentication token is invalid | ||
|
||
error.internal=Internal error |