How to create GrpcError with custom parameter details

21 Views Asked by At

For testing some functionality, I need to create some instance of GrpcError with custom details, like this:

 when(() => registerRepository.registerUser(
        any(),
        any(),
        any(),
      )).thenThrow(GrpcError.custom(13, 'Internal', []));

My problem is how to create custom details of GrpcError, as List<GeneratedMessage> with data:

gRPC Error (code: 13, codeName: INTERNAL, message: Internal, details: [typeUrl: type.googleapis.com/office.ResponseResult
  value: [8, 2, 16, 24]
  ],)

Thanks for answers!

0

There are 0 best solutions below