```suspend fun <T : Any> fail(context: PipelineCon...
# server
c
Copy code
suspend fun <T : Any> fail(context: PipelineContext<Unit, ApplicationCall>): T? {
        return try {
            context.call.receive<T>()
        } catch (ex: ContentTransformationException) {
            null
        }
    }
Copy code
Cannot use T as refined parameter. Use class instead.
Why? Would be helpful not try catching any time reseiving a parameter from body, but just once in an local inline function.
👍 1
s
I think you just need to make
fail()
a
suspend inline fun
and make the type parameter
reified T : Any
👍🏽 1
👍 1