public static void HandleException(Exception exception, IntrneuronExceptionHandlerOptions options)
        {
            if (exception == null)
            {
                return;
            }

            IExceptionHandler exceptionHandler = InterneuronExceptionHandlerFactory.GetExceptionHandler(exception);

            Task.Run(() => exceptionHandler.HandleExceptionAsync(options));
        }
Пример #2
0
        public void HandleExceptionAsync(IntrneuronExceptionHandlerOptions options)
        {
            if (options != null)
            {
                options.OnException?.Invoke(this.dbEx, dbEx.ErrorId, dbEx.ErrorResponseMessage);
            }

            if (options != null)
            {
                options.OnExceptionHandlingComplete?.Invoke(this.dbEx, dbEx.ErrorId);
            }
        }
        public void HandleExceptionAsync(IntrneuronExceptionHandlerOptions options)
        {
            var errorId = Guid.NewGuid().ToString();
            var errorResponseMessage = $"Error fetching data from database. Please check the error log with ID: {errorId} for more details";


            if (options != null)
            {
                options.OnException?.Invoke(this.ex, errorId, errorResponseMessage);
            }

            if (options != null)
            {
                options.OnExceptionHandlingComplete?.Invoke(this.ex, errorId);
            }
        }