public void Report(IExceptionNotification notification) { if (null == notification) { throw new ArgumentNullException(nameof(notification)); } string prefix = ConsoleMonitor.ComposePrefix <Exception>(notification); Console.WriteLine( SystemForCrossDomainIdentityManagementServiceResources.MonitorOutputExceptionTemplate, prefix, notification.Message, notification.Critical); }
public UnhandledExceptionManager(IExceptionNotification exceptionNotification, IAppKiller appKiller) { _exceptionNotification = exceptionNotification; _appKiller = appKiller; UserNotified = false; }
public IEnumerable <TypeScheme> Get() { string correlationIdentifier = null; try { HttpRequestMessage request = this.ConvertRequest(); if (!request.TryGetRequestIdentifier(out correlationIdentifier)) { throw new HttpResponseException(HttpStatusCode.InternalServerError); } IProvider provider = this.provider; if (null == provider) { throw new HttpResponseException(HttpStatusCode.InternalServerError); } IEnumerable <TypeScheme> result = provider.Schema; return(result); } catch (ArgumentException argumentException) { if (this.TryGetMonitor(out IMonitor monitor)) { IExceptionNotification notification = ExceptionNotificationFactory.Instance.CreateNotification( argumentException, correlationIdentifier, ServiceNotificationIdentifiers.SchemasControllerGetArgumentException); monitor.Report(notification); } throw new HttpResponseException(HttpStatusCode.BadRequest); } catch (NotImplementedException notImplementedException) { if (this.TryGetMonitor(out IMonitor monitor)) { IExceptionNotification notification = ExceptionNotificationFactory.Instance.CreateNotification( notImplementedException, correlationIdentifier, ServiceNotificationIdentifiers.SchemasControllerGetNotImplementedException); monitor.Report(notification); } throw new HttpResponseException(HttpStatusCode.NotImplemented); } catch (NotSupportedException notSupportedException) { if (this.TryGetMonitor(out IMonitor monitor)) { IExceptionNotification notification = ExceptionNotificationFactory.Instance.CreateNotification( notSupportedException, correlationIdentifier, ServiceNotificationIdentifiers.SchemasControllerGetNotSupportedException); monitor.Report(notification); } throw new HttpResponseException(HttpStatusCode.NotImplemented); } catch (Exception exception) { if (this.TryGetMonitor(out IMonitor monitor)) { IExceptionNotification notification = ExceptionNotificationFactory.Instance.CreateNotification( exception, correlationIdentifier, ServiceNotificationIdentifiers.SchemasControllerGetException); monitor.Report(notification); } throw; } }
public void Report(IExceptionNotification notification) { }
public void Report(IExceptionNotification notification) { this.consoleMonitor.Report(notification); this.Prompt(); }
public void Report(IExceptionNotification notification) { _logger.LogInformation(notification.Message, notification.Message.Message); }