graphql.nadel.instrumentation.parameters.NadelInstrumentationOnErrorParameters.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadel Show documentation
Show all versions of nadel Show documentation
Nadel is a Java library that combines multiple GrahpQL services together into one API.
package graphql.nadel.instrumentation.parameters
import graphql.execution.instrumentation.InstrumentationState
data class NadelInstrumentationOnErrorParameters(
val message: String,
val exception: Throwable,
val errorType: ErrorType,
val errorData: ErrorData,
private val instrumentationState: InstrumentationState?,
) {
fun getInstrumentationState(): T? {
@Suppress("UNCHECKED_CAST") // trust the caller
return instrumentationState as T?
}
}
sealed interface ErrorData {
data class ServiceExecutionErrorData(
val executionId: String,
val serviceName: String,
) : ErrorData
}
enum class ErrorType {
ServiceExecutionError
}