net.dankito.utils.exception.ExceptionHelper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-utils Show documentation
Show all versions of java-utils Show documentation
Some basic utils needed in many projects
The newest version!
package net.dankito.utils.exception
open class ExceptionHelper {
open fun getInnerException(exception: Exception, maxDepth: Int = 3): Exception {
var innerException = exception
var depth = 0
while(innerException.cause is Exception && depth < maxDepth) {
innerException = innerException.cause as Exception
depth++
}
return innerException
}
}