winstaan
05/09/2024, 10:47 AMvroldanbet
05/09/2024, 11:03 AMwinstaan
05/09/2024, 11:15 AMwinstaan
05/09/2024, 11:18 AMio.grpc.StatusRuntimeException
is thrown. I can't see where to get the precondition metadata from this. Could you give me a pointer?vroldanbet
05/09/2024, 11:38 AMwinstaan
05/09/2024, 12:11 PM} catch (e: StatusRuntimeException) {
if (e.status.code == Code.FAILED_PRECONDITION) {
val statusProto = io.grpc.protobuf.StatusProto.fromStatusAndTrailers(e.status, e.trailers)
val errorInfo = statusProto.getDetails(0).unpack(com.google.rpc.ErrorInfo::class.java)
val preconditionFailureDetails = errorInfo.metadataMap
vroldanbet
05/09/2024, 12:20 PMwinstaan
05/09/2024, 12:25 PMErrorReasonOuterClass.ErrorReason
- but can't see a custom type (or key constants) for the data in the metadataMap. which is ok - it's fine to work with.yetitwo
05/09/2024, 2:01 PMyetitwo
05/09/2024, 2:01 PM