aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/TimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-13 00:28:35 +0800
committercrupest <crupest@outlook.com>2020-06-13 00:28:35 +0800
commitd6e9ae92a782f747752d9e26504dc2f27e723f04 (patch)
tree57e3d021f6bd2aaa747e1e8fbffdf6a2636977f5 /Timeline/Controllers/TimelineController.cs
parentb2dcd4529bfb80fa2f1e6095cd5c976d4e90ec8e (diff)
downloadtimeline-d6e9ae92a782f747752d9e26504dc2f27e723f04.tar.gz
timeline-d6e9ae92a782f747752d9e26504dc2f27e723f04.tar.bz2
timeline-d6e9ae92a782f747752d9e26504dc2f27e723f04.zip
refactor(back): Fix #100 .
Diffstat (limited to 'Timeline/Controllers/TimelineController.cs')
-rw-r--r--Timeline/Controllers/TimelineController.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Timeline/Controllers/TimelineController.cs b/Timeline/Controllers/TimelineController.cs
index 5b894e26..6c7cfa95 100644
--- a/Timeline/Controllers/TimelineController.cs
+++ b/Timeline/Controllers/TimelineController.cs
@@ -13,6 +13,7 @@ using Timeline.Models;
using Timeline.Models.Http;
using Timeline.Models.Validation;
using Timeline.Services;
+using Timeline.Services.Exceptions;
namespace Timeline.Controllers
{
@@ -283,7 +284,7 @@ namespace Timeline.Controllers
var result = _mapper.Map<TimelineInfo>(timeline);
return result;
}
- catch (ConflictException)
+ catch (EntityAlreadyExistException e) when (e.EntityName == EntityNames.Timeline)
{
return BadRequest(ErrorResponse.TimelineController.NameConflict());
}