Spot the bug in the coroutine error mapper

from Kotlin backend development
Kotlin 2.4.10 / Ktor 3.5.1 / Java 25 LTS advanced 4 min 1 issue to find

What coroutine signal does this error mapper accidentally convert into a server error?

kotlin
suspend fun loadOrder(id: Long): ApiResult {
    return try {
        val order = repository.find(id)
        ApiResult.Ok(order)
    } catch (error: Exception) {
        logger.error("load failed", error)
        ApiResult.Failed("internal_error")
    }
}
Open in playground
Report an error