My app send image from client to server with grpc, but I cannot catch that error, here is my code:
var response;
try {
response = await dataService.sendFace(
listImageToListFaceRecImage(
dataImages, dataTrackID, dataRect, dataLandMark),
dataDeviceID,
dataDoorID);
} catch(e) {
print('Caught error: $e');
}
response.first.then((value) {
isSending = false;
print("receive");
print(value.result);
if (value.result.isNotEmpty) {
Map<String, dynamic> result =
(jsonDecode(value.result) as List<dynamic>)[0];
String personCode = result['person_code'];
replyTo.send([personCode, capturedFaceImage]);
}
});
The result I want is:
Caught error: //Error here
But it show this error and I dont know why it cannot catch:
gRPC Error (14, Error connecting: SocketException: Connection failed (OS Error: Network is unreachable, errno = 101), address = 172.16.0.39, port = 4001)