From eba8e9698c09b805d8ac2a8f58db93b947ac29e3 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 13 Jun 2020 00:28:35 +0800 Subject: refactor(back): Fix #100 . --- Timeline/Controllers/TimelineController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Timeline/Controllers/TimelineController.cs') 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(timeline); return result; } - catch (ConflictException) + catch (EntityAlreadyExistException e) when (e.EntityName == EntityNames.Timeline) { return BadRequest(ErrorResponse.TimelineController.NameConflict()); } -- cgit v1.2.3