diff --git a/Microsoft.SystemForCrossDomainIdentityManagement/Service/Controllers/ControllerTemplate.cs b/Microsoft.SystemForCrossDomainIdentityManagement/Service/Controllers/ControllerTemplate.cs index 53b2f0b3..bebb5124 100644 --- a/Microsoft.SystemForCrossDomainIdentityManagement/Service/Controllers/ControllerTemplate.cs +++ b/Microsoft.SystemForCrossDomainIdentityManagement/Service/Controllers/ControllerTemplate.cs @@ -609,6 +609,23 @@ public virtual async Task> Post([FromBody]T resource) throw new HttpResponseException(HttpStatusCode.NotImplemented); } + catch (HttpResponseException httpResponseException) + { + if (this.TryGetMonitor(out IMonitor monitor)) + { + IExceptionNotification notification = + ExceptionNotificationFactory.Instance.CreateNotification( + httpResponseException, + correlationIdentifier, + ServiceNotificationIdentifiers.ControllerTemplatePostNotSupportedException); + monitor.Report(notification); + } + + if (httpResponseException.Response.StatusCode == HttpStatusCode.Conflict) + return this.Conflict(); + else + return this.BadRequest(); + } catch (Exception exception) { if (this.TryGetMonitor(out IMonitor monitor))