public ErrorDetails(ExceptionFallback detail)
 {
     Source  = detail.Exception.Source;
     Raw     = detail.Exception.StackTrace;
     Message = detail.Exception.Message;
     Type    = detail.Exception.GetType().Name;
 }
            public DebugExceptionetails(ExceptionFallback problem)
                : base(problem.Status ?? Status500InternalServerError)
            {
                Detail   = problem.Detail ?? problem.Exception.Message;
                Title    = problem.Title ?? problem.Exception.GetType().Name;
                Instance = problem.Instance ?? GetHelpLink(problem.Exception);

                if (!string.IsNullOrEmpty(problem.Type))
                {
                    Type = problem.Type;
                }

                Errors = new ErrorDetails(problem);
            }
        private ProblemDetails GetProblemDetails(Exception exception, bool isDebug)
        {
            if (exception is ApiProblemDetailsException problem)
            {
                return(problem.Problem.Details);
            }

            var defaultException = new ExceptionFallback(exception);

            if (isDebug)
            {
                return(new DebugExceptionetails(defaultException));
            }

            return(new ApiProblemDetails((int)defaultException.Status)
            {
                Detail = defaultException.Exception.Message
            });
        }