示例#1
0
        private string Serialize(BugSenseRequest errorReport)
        {
            var ms = new MemoryStream();

            using (var requestStream = new StreamWriter(ms))
            {
                requestStream.Write("data=");
                requestStream.Write(Uri.EscapeDataString(ToJsonString(errorReport)));
            }
            return(Encoding.UTF8.GetString(ms.ToArray()));
        }
示例#2
0
        internal void SendOrStore(BugSenseRequest errorReport)
        {
            string serializedErrorReport = Serialize(errorReport);

            try
            {
                Send(serializedErrorReport);
            }
            catch (IOException)
            {
                Store(serializedErrorReport);
            }
            catch (SecurityException)
            {
                Store(serializedErrorReport);
            }
        }