Beispiel #1
0
 private void WriteErrorRequest(DreamMessage request)
 {
     try
     {
         WriteLineToLog("Request message: " + request.ToString());
     }
     catch { }
 }
Beispiel #2
0
 private void WriteErrorResponse(DreamMessage response)
 {
     WriteLineToLog("Response: " + response.ToString());
     XDoc responseDoc = response.AsDocument();
     if ((responseDoc == null) || (responseDoc.IsEmpty))
     {
         return;
     }
     XDoc messageDoc = responseDoc["message"];
     if ((messageDoc == null) || (messageDoc.IsEmpty))
     {
         return;
     }
     string messageText = messageDoc.AsText;
     if (messageText == null)
     {
         return;
     }
     WriteLineToConsole("Error: " + messageText);
 }
 private void WriteErrorResponse(DreamMessage msg, string errorText)
 {
     if (msg == null)
     {
         return;
     }
     if (msg.Status == DreamStatus.Ok)
     {
         return;
     }
     WriteLineToConsole(errorText);
     if (msg.Status != DreamStatus.Ok)
     {
         XDoc errorDoc = msg.AsDocument();
         if ((errorDoc != null) && (!errorDoc.IsEmpty))
         {
             XDoc messageDoc = errorDoc["message"];
             if ((messageDoc != null) && (!messageDoc.IsEmpty))
             {
                 string messageText = messageDoc.AsText;
                 if (!string.IsNullOrEmpty(messageText))
                 {
                     WriteLineToConsole(messageText);
                 }
             }
             WriteLineToLog(msg.ToString());
         }
     }
 }