`setProperty()` now throws exception on network error

This commit is contained in:
Tristan B. Kildaire 2020-12-18 18:02:57 +02:00
parent 689e2fd592
commit c3ece5fc00
1 changed files with 16 additions and 7 deletions

View File

@ -347,15 +347,24 @@ public final class DClient
/* Send the protocol data */
DataMessage protocolData = new DataMessage(reqRepQueue.getTag(), data);
bSendMessage(socket, protocolData.encode());
bool status = bSendMessage(socket, protocolData.encode());
/* Receive the server's response */
byte[] resp = reqRepQueue.dequeue().getData();
/* If it worked */
if(cast(bool)resp[0])
/* If the send worked */
if(status)
{
/* Receive the server's response */
byte[] resp = reqRepQueue.dequeue().getData();
/* If it worked */
if(cast(bool)resp[0])
{
}
}
/* If the send failed */
else
{
throw new DNetworkError("setprop");
}
}