Skip to content

GRpcExceptionHandler doesn't work [Kotlin] #268

Closed
@TheHett

Description

@TheHett

Hi, thanks for the work you've done. It's really great starter!

I have some trouble, maybe it related with Kotlin CoroutineImpl.
The interceptor below does not catch exception:

@GRpcService
class TempUrlService() : TempUrlServiceGrpcKt.TempUrlServiceCoroutineImplBase() {

    private val logger = KotlinLogging.logger {}

    @GRpcExceptionHandler
    fun anotherHandler(e: NullPointerException, scope: GRpcExceptionScope): Status {
        logger.warn { "NPE!" }
        return Status.INTERNAL
    }

    @Throws(Throwable::class)
    override suspend fun createThumbnailTempUrl(request: ThumbRequest): ThumbResponse {
        throw NullPointerException("HELLO")
    }
}

Using 4.5.10 version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAuto-generates notes

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions