This commit is contained in:
2020-06-15 15:05:48 +00:00
parent e7b5e1a388
commit e58a59f730
2 changed files with 30 additions and 5 deletions

View File

@@ -76,7 +76,7 @@ namespace AyaNova.Biz
//I'm thinking do not log internally failed except as trace event as this would fill up log file
//instead if they have a license issue they can do manual fetch and then that will log so they can see error
//(also it will return an error to the client)
log.LogTrace($"FetchLicense - failed: {ret}");
log.LogDebug($"FetchLicense - failed: {ret}");
}
}
finally

View File

@@ -30,6 +30,7 @@ namespace AyaNova.Core
//License server address
#if (DEBUG)
// private const string LICENSE_SERVER_URL = "https://nothing.exqqwweerccbjhjtgfample.com/";
private const string LICENSE_SERVER_URL = "http://localhost:3001/";
#else
private const string LICENSE_SERVER_URL = "https://rockfish.ayanova.com/";
@@ -532,10 +533,34 @@ namespace AyaNova.Core
}
catch (Exception ex)
{
if (calledFromInternalJob) throw ex;
var msg = "E1020 - Error fetching / installing license key";
log.LogError(ex, msg);
return msg;
if (ex is System.Net.Http.HttpRequestException)
{//communications issue or rockfish down?
if (!calledFromInternalJob)
{
//user wants to see this:
var msg = $"E1020 - COMM Error fetching / installing license key: {ex.Message}";
//we want it in the log as this is on demand so it won't fill up the log and tech support might need to see this
log.LogError(ex, msg);
return msg;
}
else
{
//happened when called from JOB, don't want to fill up the log with this error so just logdebug it and move on
var msg = $"E1020 - COMM Error fetching / installing license key (From Job)";
log.LogDebug(ex, msg);
return msg;
}
}
else
{
//some other error
if (calledFromInternalJob) throw ex;
var msg = "E1020 - Error fetching / installing license key";
log.LogError(ex, msg);
return msg;
}
}
}