protected OrientdbServerError GetErrorFromStream <T>(Stream stream)
 {
     try
     {
         var e = _serializer.Deserialize <OneToOneServerException>(stream);
         return(OrientdbServerError.Create(e));
     }
     // ReSharper disable once EmptyGeneralCatchClause
     // parsing failure of exception should not be fatal, its a best case helper.
     catch
     {
     }
     return(null);
 }
示例#2
0
        public static IList <Uri> FromStream(IOrientdbResponse response, Stream stream, IOrientdbSerializer serializer)
        {
            var result = serializer.Deserialize <NodeInfoResponse>(stream);
            var l      = new List <Uri>();

            foreach (var kv in result.nodes.Values)
            {
                if (!kv.http_address.IsNullOrEmpty())
                {
                    l.Add(Parse("http", kv.http_address));
                }
                else if (!kv.https_address.IsNullOrEmpty())
                {
                    l.Add(Parse("https", kv.https_address));
                }
                else if (!kv.thrift_address.IsNullOrEmpty())
                {
                    l.Add(Parse("http", kv.thrift_address));
                }
            }
            return(l);
        }