diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Web/Controllers')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs index deaa7cf48..28637d97c 100644 --- a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs +++ b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -61,7 +60,7 @@ namespace Tango.Web.Controllers HttpStatusCode code = HttpStatusCode.InternalServerError; - if (ex is ArgumentException || ex is InvalidDataException) + if (ex is ArgumentException) { code = HttpStatusCode.BadRequest; } @@ -69,21 +68,8 @@ namespace Tango.Web.Controllers { code = HttpStatusCode.Unauthorized; } - else if (ex is KeyNotFoundException) - { - code = HttpStatusCode.NotFound; - } - HttpResponseException httpException = null; - - if (ex is HttpResponseException httpResponseException) - { - httpException = httpResponseException; - } - else - { - httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage(), ex)); - } + var httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage())); #if DEBUG throw httpException; @@ -97,7 +83,7 @@ namespace Tango.Web.Controllers if (expandedExceptionValues != null) { - expandedExceptionValues["StackTrace"] = ""; + expandedExceptionValues["StackTrace"] = "StackTrace not provided."; } } #endif |
