mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:06:50 +00:00
Improved code
This commit is contained in:
parent
d2d83dfe58
commit
ea5701000b
@ -496,26 +496,15 @@ class Boot extends MdcLoggable {
|
||||
}
|
||||
}
|
||||
|
||||
private def showException(le: Throwable): String = {
|
||||
val ret = "Message: " + le.toString + "\n\t" +
|
||||
le.getStackTrace.map(_.toString).mkString("\n\t") + "\n"
|
||||
private def showExceptionAtJson(error: Throwable): String = {
|
||||
val formattedError = "Message: " + error.toString + error.getStackTrace.map(_.toString).mkString(" ")
|
||||
|
||||
val also = le.getCause match {
|
||||
val formattedCause = error.getCause match {
|
||||
case null => ""
|
||||
case sub: Throwable => "\nCaught and thrown by:\n" + showException(sub)
|
||||
case cause: Throwable => "Caught and thrown by: " + showExceptionAtJson(cause)
|
||||
}
|
||||
|
||||
ret + also
|
||||
}
|
||||
private def showExceptionAtJson(le: Throwable): String = {
|
||||
val ret = "Message: " + le.toString + le.getStackTrace.map(_.toString).mkString(" ")
|
||||
|
||||
val also = le.getCause match {
|
||||
case null => ""
|
||||
case sub: Throwable => "Caught and thrown by: " + showExceptionAtJson(sub)
|
||||
}
|
||||
|
||||
ret + also
|
||||
formattedError + formattedCause
|
||||
}
|
||||
|
||||
private def sendExceptionEmail(exception: Throwable): Unit = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user