try to reduce log spam on http fails

This commit is contained in:
UbitUmarov
2023-05-24 14:16:43 +01:00
parent 5e0c6446d8
commit d7714530a8
4 changed files with 20 additions and 20 deletions

View File

@@ -617,7 +617,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return false;
}
}
catch (WebException e)
catch (Exception e)
{
m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0} : {1}", reginfo.ServerURI.ToString(), e.Message);
}

View File

@@ -849,7 +849,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
userdata.ServerURLs = uConn.GetServerURLs(userID);
}
catch(System.Net.WebException e)
catch (System.Net.Http.HttpRequestException e)
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: GetServerURLs call failed {0}", e.Message);
WebUtil.GlobalExpiringBadURLs.Add(homeuri, BADURLEXPIRE * 1000);
@@ -857,7 +857,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
}
catch (Exception e)
{
m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e);
m_log.Debug($"[USER MANAGEMENT MODULE]: GetServerURLs call failed {e.Message}");
userdata.ServerURLs = new Dictionary<string, object>();
}
@@ -919,7 +919,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
userdata.ServerURLs = uConn.GetServerURLs(userID);
}
catch (System.Net.WebException e)
catch (System.Net.Http.HttpRequestException e)
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: GetServerURLs call failed {0}", e.Message);
userdata.ServerURLs = new Dictionary<string, object>();
@@ -929,7 +929,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
}
catch (Exception e)
{
m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e);
m_log.Debug($"[USER MANAGEMENT MODULE]: GetServerURLs call failed {e.Message}");
userdata.ServerURLs = new Dictionary<string, object>();
userdata.LastWebFail = Util.GetTimeStamp();
recentFail = true;

View File

@@ -39,6 +39,7 @@ using OpenSim.Framework.ServiceAuth;
using OpenSim.Services.Connectors;
using OpenSim.Services.Interfaces;
using OpenSim.Server.Base;
using System.Net.Http;
namespace OpenSim.Services.Connectors
{
@@ -319,25 +320,24 @@ namespace OpenSim.Services.Connectors
reply = SynchronousRestFormsRequester.MakeRequest(verb, uri, formdata, 30, m_Auth);
return reply;
}
catch (WebException e)
catch (HttpRequestException e)
{
using (HttpWebResponse hwr = (HttpWebResponse)e.Response)
if (e.StatusCode is HttpStatusCode status)
{
if (hwr != null)
if (status == HttpStatusCode.Unauthorized)
{
if (hwr.StatusCode == HttpStatusCode.NotFound)
{
m_log.Error(string.Format("[ESTATE CONNECTOR]: Resource {0} not found ", uri));
return reply;
}
if (hwr.StatusCode == HttpStatusCode.Unauthorized)
m_log.Error(string.Format("[ESTATE CONNECTOR]: Web request {0} requires authentication ", uri));
m_log.Error(string.Format("[ESTATE CONNECTOR]: Web request {0} requires authentication ", uri));
}
else if (status != HttpStatusCode.NotFound)
{
m_log.Error(string.Format("[ESTATE CONNECTOR]: Resource {0} not found ", uri));
return reply;
}
else
m_log.Error(string.Format(
"[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}",
verb, uri, formdata, e.Message));
}
else
m_log.Error(string.Format(
"[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}",
verb, uri, formdata, e.Message));
}
catch (Exception e)
{

View File

@@ -84,7 +84,7 @@ namespace OpenSim.Services.Connectors.InstantMessage
return false;
}
}
catch (WebException e)
catch (Exception e)
{
m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0} : {1}", url, e.Message);
}