Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add request verb and url to error messages in WebUtil that lack this.

Make exception printing consistent across windows and mono.
  • Loading branch information...
commit 4c4ffb986897dfc66d296aa30f6111393eb02710 1 parent e52fe03
Justin Clark-Casey justincc authored

Showing 1 changed file with 38 additions and 17 deletions. Show diff stats Hide diff stats

  1. +38 17 OpenSim/Framework/WebUtil.cs
55 OpenSim/Framework/WebUtil.cs
@@ -86,8 +86,7 @@ private static object EndPointLock(string url)
86 86 return eplock;
87 87 }
88 88 }
89   -
90   -
  89 +
91 90 #region JSONRequest
92 91
93 92 /// <summary>
@@ -216,7 +215,9 @@ private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string me
216 215 reqnum,url,method,tickdiff,tickdata);
217 216 }
218 217
219   - m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
  218 + m_log.DebugFormat(
  219 + "[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
  220 +
220 221 return ErrorResponseMap(errorMessage);
221 222 }
222 223
@@ -357,7 +358,8 @@ private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection d
357 358 reqnum,url,method,tickdiff,tickdata);
358 359 }
359 360
360   - m_log.WarnFormat("[WEB UTIL]: <{0}> form request failed: {1}",reqnum,errorMessage);
  361 + m_log.WarnFormat("[WEB UTIL]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
  362 +
361 363 return ErrorResponseMap(errorMessage);
362 364 }
363 365
@@ -771,12 +773,16 @@ public static class AsynchronousRestObjectRequester
771 773 }
772 774 else
773 775 {
774   - m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
  776 + m_log.ErrorFormat(
  777 + "[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}",
  778 + verb, requestUrl, e.Status, e.Message);
775 779 }
776 780 }
777 781 catch (Exception e)
778 782 {
779   - m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
  783 + m_log.ErrorFormat(
  784 + "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
  785 + verb, requestUrl, e.Message, e.StackTrace);
780 786 }
781 787
782 788 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
@@ -788,7 +794,8 @@ public static class AsynchronousRestObjectRequester
788 794 catch (Exception e)
789 795 {
790 796 m_log.ErrorFormat(
791   - "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
  797 + "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}",
  798 + verb, requestUrl, e.Message, e.StackTrace);
792 799 }
793 800
794 801 }, null);
@@ -841,7 +848,8 @@ public static string MakeRequest(string verb, string requestUrl, string obj)
841 848 }
842 849 catch (Exception e)
843 850 {
844   - m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
  851 + m_log.DebugFormat(
  852 + "[FORMS]: exception occured {0} {1}: {2}{3}", verb, requestUrl, e.Message, e.StackTrace);
845 853 }
846 854 finally
847 855 {
@@ -867,7 +875,9 @@ public static string MakeRequest(string verb, string requestUrl, string obj)
867 875 }
868 876 catch (Exception e)
869 877 {
870   - m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
  878 + m_log.DebugFormat(
  879 + "[FORMS]: Exception occured on receiving {0} {1}: {2}{3}",
  880 + verb, requestUrl, e.Message, e.StackTrace);
871 881 }
872 882 finally
873 883 {
@@ -880,7 +890,7 @@ public static string MakeRequest(string verb, string requestUrl, string obj)
880 890 catch (System.InvalidOperationException)
881 891 {
882 892 // This is what happens when there is invalid XML
883   - m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
  893 + m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving {0} {1}", verb, requestUrl);
884 894 }
885 895 }
886 896 return respstring;
@@ -938,7 +948,10 @@ public class SynchronousRestObjectRequester
938 948 }
939 949 catch (Exception e)
940 950 {
941   - m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
  951 + m_log.DebugFormat(
  952 + "[SynchronousRestObjectRequester]: Exception in making request {0} {1}: {2}{3}",
  953 + verb, requestUrl, e.Message, e.StackTrace);
  954 +
942 955 return deserial;
943 956 }
944 957 finally
@@ -960,7 +973,11 @@ public class SynchronousRestObjectRequester
960 973 respStream.Close();
961 974 }
962 975 else
963   - m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
  976 + {
  977 + m_log.DebugFormat(
  978 + "[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}",
  979 + verb, requestUrl);
  980 + }
964 981 }
965 982 }
966 983 catch (WebException e)
@@ -971,20 +988,24 @@ public class SynchronousRestObjectRequester
971 988 return deserial;
972 989 else
973 990 m_log.ErrorFormat(
974   - "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}",
975   - requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
  991 + "[SynchronousRestObjectRequester]: WebException for {0} {1} {2}: {3} {4}",
  992 + verb, requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
976 993 }
977 994 catch (System.InvalidOperationException)
978 995 {
979 996 // This is what happens when there is invalid XML
980   - m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
  997 + m_log.DebugFormat(
  998 + "[SynchronousRestObjectRequester]: Invalid XML from {0} {1} {2}",
  999 + verb, requestUrl, typeof(TResponse).ToString());
981 1000 }
982 1001 catch (Exception e)
983 1002 {
984   - m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
  1003 + m_log.DebugFormat(
  1004 + "[SynchronousRestObjectRequester]: Exception on response from {0} {1}: {2}{3}",
  1005 + verb, requestUrl, e.Message, e.StackTrace);
985 1006 }
986 1007
987 1008 return deserial;
988 1009 }
989 1010 }
990   -}
  1011 +}

0 comments on commit 4c4ffb9

Please sign in to comment.
Something went wrong with that request. Please try again.