Example #1
0
 public static new DataPacket Deserialize(string json)
 {
     try
     {
         var ret = new MsgQueryFail();
         var obj = Json.Decode(json);
         ret.Id = obj["id"];
         if (ret.Id == null)
             throw new ParseException(json, "No id supplied");
         ret.Message = obj["message"];
         if (ret.Message == null)
             throw new ParseException(json, "No message supplied");
         return ret;
     }
     catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
     {
         throw new ParseException(json, "General binding exception. Was something invalid?");
     }
     catch (ArgumentException)
     {
         throw new ParseException(json, "Invalid JSON");
     }
 }