aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-11-18 03:33:34 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-11-18 03:33:34 +0200
commitdb1876bf3310a672176588329033ab4efc955175 (patch)
tree7e8ed4debe87d6ba2e72a30a49d97d885a322134 /Software/Visual_Studio
parent2ef57b73b1dc6da51a9c3353d93a815f58ea22e0 (diff)
downloadTango-db1876bf3310a672176588329033ab4efc955175.tar.gz
Tango-db1876bf3310a672176588329033ab4efc955175.zip
Fixed exception issue in TangoController.
Removed big first diagnostics response and hardware configuration request.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs9
-rw-r--r--Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs6
2 files changed, 11 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 2bec38f82..93320c646 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -654,7 +654,9 @@ namespace Tango.Integration.Operation
bool responseLogged = false;
_diagnosticsSent = true;
- SendContinuousRequest<StartDiagnosticsRequest, StartDiagnosticsResponse>(request, new TransportContinuousRequestConfig() { ShouldLog = true }).ObserveOn(new NewThreadScheduler()).Subscribe(
+ LogManager.Log($"Sending '{nameof(StartDiagnosticsRequest)}'...");
+
+ SendContinuousRequest<StartDiagnosticsRequest, StartDiagnosticsResponse>(request, new TransportContinuousRequestConfig() { ShouldLog = false }).ObserveOn(new NewThreadScheduler()).Subscribe(
(response) =>
{
if (!responseLogged)
@@ -3236,8 +3238,11 @@ namespace Tango.Integration.Operation
try
{
+ LogManager.Log($"Sending '{nameof(UploadHardwareConfigurationRequest)}'...");
+ LogManager.Log($"{nameof(UploadHardwareConfigurationRequest)} request:\n{request.HardwareConfiguration.ToJsonString()}", LogCategory.Debug);
+
CurrentHardwareConfiguration = hardwareConfiguration;
- response = await SendRequest<UploadHardwareConfigurationRequest, UploadHardwareConfigurationResponse>(request, new TransportRequestConfig() { ShouldLog = true });
+ response = await SendRequest<UploadHardwareConfigurationRequest, UploadHardwareConfigurationResponse>(request, new TransportRequestConfig() { ShouldLog = false });
}
catch (Exception ex)
{
diff --git a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
index 0f69bf570..deaa7cf48 100644
--- a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
+++ b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
@@ -60,7 +60,6 @@ namespace Tango.Web.Controllers
LogManager.Log(ex, $"An error occurred while processing the request message on {controllerName + "/" + actionName}.");
HttpStatusCode code = HttpStatusCode.InternalServerError;
- HttpResponseException httpException = null;
if (ex is ArgumentException || ex is InvalidDataException)
{
@@ -74,7 +73,10 @@ namespace Tango.Web.Controllers
{
code = HttpStatusCode.NotFound;
}
- else if (ex is HttpResponseException httpResponseException)
+
+ HttpResponseException httpException = null;
+
+ if (ex is HttpResponseException httpResponseException)
{
httpException = httpResponseException;
}