public BaseCustomError(string methodName, ErrorTypes errorType, object values = null, Exception innerException = null) : base(errorType.GetDescription(), innerException) { this.ErrorResponse = new ErrorResponse() .SetError() .SetMethodName(methodName) .SetMessage(errorType.GetDescription()) .SetErrorValues(values) .SetInnerException(innerException?.Message) .SetStackTrace(innerException?.StackTrace); }
public static Result CreateFail([NotNull] string message, ErrorTypes errorType = 0) { message = string.Join(":", errorType.GetDescription(), message); return(new Result(false, message, errorType: errorType)); }