WpiHelper: better exception messages
This commit is contained in:
parent
8e31522862
commit
c497964726
1 changed files with 11 additions and 11 deletions
|
@ -621,11 +621,12 @@ namespace WebsitePanel.Server.Code
|
||||||
|
|
||||||
_productManager = new ProductManager();
|
_productManager = new ProductManager();
|
||||||
|
|
||||||
if (TryLoadFeeds())
|
try
|
||||||
{
|
{
|
||||||
|
TryLoadFeeds();
|
||||||
// ok, all feeds loaded
|
// ok, all feeds loaded
|
||||||
}
|
}
|
||||||
else
|
catch(Exception ex1)
|
||||||
{
|
{
|
||||||
// feed loading failed
|
// feed loading failed
|
||||||
|
|
||||||
|
@ -636,23 +637,25 @@ namespace WebsitePanel.Server.Code
|
||||||
|
|
||||||
// re-create product manager
|
// re-create product manager
|
||||||
_productManager = new ProductManager();
|
_productManager = new ProductManager();
|
||||||
if (TryLoadFeeds())
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// loaded first (default) feed only
|
// loaded first (default) feed only
|
||||||
|
TryLoadFeeds();
|
||||||
}
|
}
|
||||||
else
|
catch(Exception ex2)
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("WpiHelper: download all feeds failed"));
|
throw new Exception(string.Format("WpiHelper: download first feed failed: {0}", ex2), ex2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("WpiHelper: download all feeds failed"));
|
throw new Exception(string.Format("WpiHelper: download all ({0}) feeds failed: {1}", _feeds.Count, ex1), ex1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryLoadFeeds()
|
private void TryLoadFeeds()
|
||||||
{
|
{
|
||||||
string loadingFeed = null;
|
string loadingFeed = null;
|
||||||
|
|
||||||
|
@ -680,12 +683,9 @@ namespace WebsitePanel.Server.Code
|
||||||
// error occured on loading this feed
|
// error occured on loading this feed
|
||||||
// log this
|
// log this
|
||||||
WriteLog(string.Format("Feed {0} loading error: {1}", loadingFeed, ex));
|
WriteLog(string.Format("Feed {0} loading error: {1}", loadingFeed, ex));
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Language GetLanguage(string languageId)
|
private Language GetLanguage(string languageId)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue