diff options
author | Justin Clark-Casey (justincc) | 2012-04-26 00:43:31 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-26 00:43:31 +0100 |
commit | 4c4ffb986897dfc66d296aa30f6111393eb02710 (patch) | |
tree | 8847d1341f450f58c95b366ac0cf3eaae77dd0eb /OpenSim/Framework/WebUtil.cs | |
parent | minor: Add avatar name to removing agent log message (diff) | |
download | opensim-SC-4c4ffb986897dfc66d296aa30f6111393eb02710.zip opensim-SC-4c4ffb986897dfc66d296aa30f6111393eb02710.tar.gz opensim-SC-4c4ffb986897dfc66d296aa30f6111393eb02710.tar.bz2 opensim-SC-4c4ffb986897dfc66d296aa30f6111393eb02710.tar.xz |
Add request verb and url to error messages in WebUtil that lack this.
Make exception printing consistent across windows and mono.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index ead8f46..d2aa538 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -86,8 +86,7 @@ namespace OpenSim.Framework | |||
86 | return eplock; | 86 | return eplock; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | |||
91 | #region JSONRequest | 90 | #region JSONRequest |
92 | 91 | ||
93 | /// <summary> | 92 | /// <summary> |
@@ -216,7 +215,9 @@ namespace OpenSim.Framework | |||
216 | reqnum,url,method,tickdiff,tickdata); | 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 | return ErrorResponseMap(errorMessage); | 221 | return ErrorResponseMap(errorMessage); |
221 | } | 222 | } |
222 | 223 | ||
@@ -357,7 +358,8 @@ namespace OpenSim.Framework | |||
357 | reqnum,url,method,tickdiff,tickdata); | 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 | return ErrorResponseMap(errorMessage); | 363 | return ErrorResponseMap(errorMessage); |
362 | } | 364 | } |
363 | 365 | ||
@@ -771,12 +773,16 @@ namespace OpenSim.Framework | |||
771 | } | 773 | } |
772 | else | 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 | catch (Exception e) | 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 | // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); | 788 | // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); |
@@ -788,7 +794,8 @@ namespace OpenSim.Framework | |||
788 | catch (Exception e) | 794 | catch (Exception e) |
789 | { | 795 | { |
790 | m_log.ErrorFormat( | 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 | }, null); | 801 | }, null); |
@@ -841,7 +848,8 @@ namespace OpenSim.Framework | |||
841 | } | 848 | } |
842 | catch (Exception e) | 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 | finally | 854 | finally |
847 | { | 855 | { |
@@ -867,7 +875,9 @@ namespace OpenSim.Framework | |||
867 | } | 875 | } |
868 | catch (Exception e) | 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 | finally | 882 | finally |
873 | { | 883 | { |
@@ -880,7 +890,7 @@ namespace OpenSim.Framework | |||
880 | catch (System.InvalidOperationException) | 890 | catch (System.InvalidOperationException) |
881 | { | 891 | { |
882 | // This is what happens when there is invalid XML | 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 | return respstring; | 896 | return respstring; |
@@ -938,7 +948,10 @@ namespace OpenSim.Framework | |||
938 | } | 948 | } |
939 | catch (Exception e) | 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 | return deserial; | 955 | return deserial; |
943 | } | 956 | } |
944 | finally | 957 | finally |
@@ -960,7 +973,11 @@ namespace OpenSim.Framework | |||
960 | respStream.Close(); | 973 | respStream.Close(); |
961 | } | 974 | } |
962 | else | 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 | catch (WebException e) | 983 | catch (WebException e) |
@@ -971,20 +988,24 @@ namespace OpenSim.Framework | |||
971 | return deserial; | 988 | return deserial; |
972 | else | 989 | else |
973 | m_log.ErrorFormat( | 990 | m_log.ErrorFormat( |
974 | "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}", | 991 | "[SynchronousRestObjectRequester]: WebException for {0} {1} {2}: {3} {4}", |
975 | requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); | 992 | verb, requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); |
976 | } | 993 | } |
977 | catch (System.InvalidOperationException) | 994 | catch (System.InvalidOperationException) |
978 | { | 995 | { |
979 | // This is what happens when there is invalid XML | 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 | catch (Exception e) | 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 | return deserial; | 1008 | return deserial; |
988 | } | 1009 | } |
989 | } | 1010 | } |
990 | } | 1011 | } \ No newline at end of file |