Handle error

This commit is contained in:
Tristan B. Kildaire 2020-12-04 14:11:55 +02:00
parent a246ef1d73
commit d1e1297a26
1 changed files with 14 additions and 10 deletions

View File

@ -54,19 +54,23 @@ public final class DPlugin
/* TODO: Error handling */
status = sendMessage(socket, data);
/* Get the reply */
/* TODO: Error handling */
byte[] reply;
receiveMessage(socket, reply);
/* Close the connetion to the plugin server */
socket.close();
/* Encode the status in the reply */
response ~= [status];
/* Encode the response */
response ~= reply;
/* If the send succeeded */
if(status)
{
/* Get the reply */
/* TODO: Error handling */
byte[] reply;
receiveMessage(socket, reply);
/* Close the connetion to the plugin server */
socket.close();
/* Encode the response */
response ~= reply;
}
return response;
}