Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
package com.jetbrains.rd.util.reactive

import com.jetbrains.rd.util.ExecutionException
import com.jetbrains.rd.util.getThrowableText

expect class RdFault constructor(
reasonTypeFqn: String,
reasonMessage: String,
localizedReasonMessage: String,
reasonAsText: String,
reason: Throwable? = null
) : ExecutionException {
val reasonTypeFqn: String
val reasonMessage: String
val localizedReasonMessage: String
val reasonAsText: String

class RdFault constructor(val reasonTypeFqn: String, val reasonMessage: String, val reasonAsText: String, reason: Throwable? = null)
: ExecutionException(reasonMessage + if (reason == null) ", reason: $reasonAsText" else "", reason) {
constructor(reason: Throwable)

constructor (reason: Throwable) : this (reason::class.simpleName?:"", reason.message ?: "-- no message --", reason.getThrowableText(), reason) {
}
}
@Deprecated("Use the override with localizedReasonMessage")
constructor(reasonTypeFqn: String, reasonMessage: String, reasonAsText: String, reason: Throwable? = null)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.jetbrains.rd.util.reactive

import com.jetbrains.rd.util.ExecutionException
import com.jetbrains.rd.util.getThrowableText

actual class RdFault actual constructor(
actual val reasonTypeFqn: String,
actual val reasonMessage: String,
actual val localizedReasonMessage: String,
actual val reasonAsText: String,
reason: Throwable?
) : ExecutionException(reasonMessage + if (reason == null) ", reason: $reasonAsText" else "", reason) {

actual constructor (reason: Throwable) : this(
reason::class.simpleName ?: "",
reason.message ?: "-- no message --",
reason.message ?: "-- no message --",
reason.getThrowableText(),
reason
)

@Deprecated("Use the override with localizedReasonMessage")
actual constructor(reasonTypeFqn: String, reasonMessage: String, reasonAsText: String, reason: Throwable?) : this(
reasonTypeFqn,
reasonMessage,
reasonMessage,
reasonAsText,
reason
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.jetbrains.rd.util.reactive

import com.jetbrains.rd.util.ExecutionException
import com.jetbrains.rd.util.getThrowableText
import org.jetbrains.annotations.Nls

actual class RdFault actual constructor(
actual val reasonTypeFqn: String,
actual val reasonMessage: String,
@field:Nls @get:Nls @Nls actual val localizedReasonMessage: String,
actual val reasonAsText: String,
reason: Throwable?
) : ExecutionException(reasonMessage + if (reason == null) ", reason: $reasonAsText" else "", reason) {

actual constructor(reason: Throwable) : this(
reason::class.simpleName ?: "",
reason.message ?: "-- no message --",
reason.localizedMessage ?: reason.message ?: "-- no message --",
reason.getThrowableText(),
reason
)

@Deprecated("Use the override with localizedReasonMessage")
actual constructor(reasonTypeFqn: String, reasonMessage: String, reasonAsText: String, reason: Throwable?) : this(
reasonTypeFqn,
reasonMessage,
reasonMessage,
reasonAsText,
reason
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class TestExample {
classloader.scanForResourcesContaining("com.jetbrains.rd.util") +
classloader.scanForResourcesContaining("org.jetbrains.annotations")

rdgen.verbose *= true
rdgen.classpath *= rdFrameworkClasspath.joinToString(File.pathSeparator)

val generatedSources = File(kotlinGeneratedSourcesDir).walk().toList()
Expand Down