From dcaf457bb82221a90d56e4be057766c898f5c2dd Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 20 Apr 2008 19:07:42 +0000 Subject: * Change user inventory create from explicit 'create user' command on the console from sync to async * Catch more error conditions and provide more messages when things go wrong --- OpenSim/Grid/UserServer/Main.cs | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'OpenSim/Grid/UserServer/Main.cs') diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 19f037f..0f0104e 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -157,7 +157,9 @@ namespace OpenSim.Grid.UserServer if (null != m_userManager.GetUserProfile(tempfirstname, templastname)) { - m_log.ErrorFormat("[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); + m_log.ErrorFormat( + "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); + break; } @@ -166,22 +168,40 @@ namespace OpenSim.Grid.UserServer LLUUID userID = new LLUUID(); try { - userID = - m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); - } catch (Exception ex) + userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); + } + catch (Exception ex) { m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); } try { - RestObjectPoster.BeginPostObject(m_userManager._config.InventoryUrl + "CreateInventory/", - userID.UUID); + bool created + = SynchronousRestObjectPoster.BeginPostObject( + "POST", m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); + + if (!created) + { + throw new Exception( + String.Format( + "The inventory creation request for user {0} did not succeed." + + " Please contact your inventory service provider for more information.", + userID)); + } + + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat( + "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", + m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); } - catch (Exception ex) + catch (Exception e) { - m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", ex.ToString()); + m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); } + m_lastCreatedUser = userID; break; } -- cgit v1.1