IJPL-166285 Fix accessing unregistered RPC breaks following RPC calls

If RPC is not followed, backend throws an error `No remote API found for InstanceId` in `RemoteApiRegistry.resolve`.
`RpcExecutor`, however, expects this method to return `null` if service was not found, not an exception.

Therefore, the exception is propagated upward which breaks the kernel and prevents further RPC calls from executing.

We should adhere to the API requirements and return `null` if service was not found instead of throwing an error.

GitOrigin-RevId: bbf70f1fe1cb0e7fb80bcc72ca0b161452a36f58
This commit is contained in:
Kate Botsman
2024-11-06 10:47:41 +01:00
committed by intellij-monorepo-bot
parent 6f9ba26707
commit c86bc3c11d

View File

@@ -67,8 +67,7 @@ internal class RemoteApiRegistry(coroutineScope: CoroutineScope) : RemoteApiProv
?: throw IllegalStateException("No remote API found for $descriptor")
}
override fun resolve(serviceId: InstanceId): ServiceImplementation {
override fun resolve(serviceId: InstanceId): ServiceImplementation? {
return remoteApis[serviceId.id]
?: throw IllegalStateException("No remote API found for $serviceId")
}
}