Fix incomplete printing of exceptions (of the all types) in tests

This commit is contained in:
victor.petukhov
2018-12-13 12:36:12 +03:00
parent 0a8e29838f
commit 725832a281
@@ -19,19 +19,18 @@ enum class TestsExceptionFilePostfix(val text: String) {
INFRASTRUCTURE_ERROR("infrastructure") INFRASTRUCTURE_ERROR("infrastructure")
} }
sealed class TestsError(val postfix: TestsExceptionFilePostfix) : Error() { sealed class TestsError(val original: Throwable, val postfix: TestsExceptionFilePostfix) : Error() {
abstract val original: Throwable
override fun toString() = original.toString() override fun toString() = original.toString()
override fun getStackTrace() = original.stackTrace override fun getStackTrace() = original.stackTrace
} override fun initCause(cause: Throwable?) = original.initCause(cause)
class TestsCompilerError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.COMPILER_ERROR)
class TestsInfrastructureError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.INFRASTRUCTURE_ERROR)
class TestsCompiletimeError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.COMPILETIME_ERROR)
class TestsRuntimeError(override val original: Throwable) : TestsError(TestsExceptionFilePostfix.RUNTIME_ERROR) {
override val cause = original.cause override val cause = original.cause
} }
class TestsCompilerError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.COMPILER_ERROR)
class TestsInfrastructureError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.INFRASTRUCTURE_ERROR)
class TestsCompiletimeError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.COMPILETIME_ERROR)
class TestsRuntimeError(original: Throwable) : TestsError(original, TestsExceptionFilePostfix.RUNTIME_ERROR)
private enum class ExceptionType { private enum class ExceptionType {
ANALYZING_EXPRESSION, ANALYZING_EXPRESSION,
UNKNOWN UNKNOWN