Beispiel #1
0
        internal static IResult <TContent> FailLazyEvaluatedFunctionFromException <TContent>(int progrId, [NotNull] IIdentifier identifier
                                                                                             , Exception exception, EventId?eventId = null, [CanBeNull] string errorMessage = null, [CanBeNull] string outputMessage = null)
        {
            var msg  = string.IsNullOrEmpty(errorMessage) ? exception.Message : errorMessage;
            var err0 = Error.FromException(exception, eventId);
            var err  = new LazyEvaluatedError(progrId, msg, outputMessage, eventId, err0);

            return(Fail <TContent>(identifier, err));
        }
Beispiel #2
0
        internal static IResult <TContent> FailLazyEvaluatedFunction <TContent>(int progrId, [NotNull] IIdentifier identifier, [NotNull] IError error)
        {
            //var l = new List<LazyEvaluatedError>();
            //foreach (var error in errors)
            //{
            //    LazyEvaluatedError err = error as LazyEvaluatedError
            //                             ?? new LazyEvaluatedError(progrId, error.ErrorMessage, error.OutputMessage, error.ErrorEventId, error.InnerError);
            //    l.Add(err);
            //}

            //return Fail<TContent>(identifier, l.OrderBy(x => x.ProgrId).ToArray());
            LazyEvaluatedError err = error as LazyEvaluatedError
                                     ?? new LazyEvaluatedError(progrId, error.ErrorMessage, error.OutputMessage, error.ErrorEventId, error.InnerError);

            return(Fail <TContent>(identifier, err));
        }