Closed tforkmann closed 3 years ago
Well, Exception
is not supported (does it work with JSON?). You might have to define an explicit DU for the error types or just use a string (for the message and/or call stack).
There is no error in the data. It is just a array. The exception only appears if I add in binarySerialization. It works very without binarySerialization.
MsgPack constructs a serializer for the entire model at first, while JSON (I believe) only works off the current message. What happens in JSON if you include CurrentPiStatus.IsStopped
, where I assume the exception is nested? We might be able to implement it, but the exception type information would be lost, you'd just have the message, and I think that would possibly be worse than nothing. Inheritance is one of the reasons why classes in general aren't supported either.
@tforkmann can you share the type of ClientError? If it has an Ezception type there, it won't work, even with JSON. The reasoning is that exceptions shouldn't be transferred over the network, especially when some of them might contain sensitive data
@Zaid-Ajaj I'm getting following error msg from the Client
response { StatusCode = 500
ResponseBody = {"error":"Error occured while running the function HeartBeatTable","ignored":true,"handled":true} } responseText {"error":"Error occured while running the function HeartBeatTable","ignored":true,"handled":true} status code 500 exn Internal server error (500) while making request to /api/IDataServerApi/HeartBeatTable
I don't think that helps much.
What happens in JSON if you include CurrentPiStatus.IsStopped, where I assume the exception is nested?
👆
@tforkmann can you share the type of ClientError?
👆
type ErrorCode =
| ConnectionFailure = 3
| ReceiveTimeout = 4
| DataReceive = 5
| TCPDataSend = 7
| TCPNotConnected = 9
type ClientError =
| ChannelError of S7Error.ErrorCode
| DataError
| NoDataFromCurrentMappingInfo
| NoMappingInfo
| NoClientStatusInDb of exn option
JSON still works even with if I set CurrentPiStatus.IsStopped (ChannelError (ErrorCode.ConnectionFailure ))
The issue is NoClientStatusInDb
.
The JSON is then failing as well.
Ok that was it!
Thanks. Serialization works well now!
Error msg:
Here response type:
Transfered Msg is a PlantWithHeartBeat array
The msg is quite big. msg2.txt