aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Web
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-11-23 16:13:53 +0200
committerMirta <mirta@twine-s.com>2020-11-23 16:13:53 +0200
commit91c007adced573e09b77ab4be4a5aba623a816cc (patch)
tree250221fc2def7d59f1393be8394f766faf576656 /Software/Visual_Studio/Tango.Web
parent4e9af2b852eb3b9eecfa09e9bc76869558e183cb (diff)
parent50a3c0b857b4aa88a9e3970d69256f12b5b24eb8 (diff)
downloadTango-91c007adced573e09b77ab4be4a5aba623a816cc.tar.gz
Tango-91c007adced573e09b77ab4be4a5aba623a816cc.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.Web')
-rw-r--r--Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
index b3df0373e..deaa7cf48 100644
--- a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
+++ b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
@@ -69,8 +69,21 @@ namespace Tango.Web.Controllers
{
code = HttpStatusCode.Unauthorized;
}
+ else if (ex is KeyNotFoundException)
+ {
+ code = HttpStatusCode.NotFound;
+ }
- var httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage(), ex));
+ HttpResponseException httpException = null;
+
+ if (ex is HttpResponseException httpResponseException)
+ {
+ httpException = httpResponseException;
+ }
+ else
+ {
+ httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage(), ex));
+ }
#if DEBUG
throw httpException;