Exemple #1
0
 public ErrorCode(IErrorCode other, ArgumentPlaceholder <string> description = default, ArgumentPlaceholder <SeverityLevel?> severityLevel = default)
     : this(
         identifier : other.EnsureNotNull(nameof(other)).Value.Identifier,
         severityLevel : severityLevel.Substitute(value : other.SeverityLevel),
         description : description.Substitute(value : other.Description))
 {
 }
Exemple #2
0
 public InteractionFaultCode(IErrorCode code)
 {
     code.EnsureNotNull(nameof(code));
     //
     Identifier    = code.Identifier;
     Description   = code.Description;
     SeverityLevel = code.SeverityLevel;
 }
Exemple #3
0
 public ErrorLogMiddleware(RequestDelegate next,
                           ILoggerFactory loggerFactory,
                           IErrorCode errorCodeStore)
 {
     _next           = next;
     _logger         = loggerFactory.CreateLogger <ErrorLogMiddleware>();
     _errorCodeStore = errorCodeStore;
 }
Exemple #4
0
 public OrderCloudIntegrationException(IErrorCode errorCode, object data)
 {
     ApiError = new ApiError
     {
         ErrorCode = errorCode.Code,
         Message   = errorCode.DefaultMessage,
         Data      = data
     };
 }
Exemple #5
0
 public GrException(
     string?message       = null,
     IErrorCode?errorCode = null,
     Exception?cause      = null
     )
     : base(message, cause)
 {
     ErrorCode = errorCode ?? CommonErrorCodes.UnknownError;
 }
Exemple #6
0
        public override IEnumerable <object> Run()
        {
            yield return(null);

            IErrorCode <TErrorCode> op = base.Operation;

            if (op == null)
            {
                Log <EnumProcessor <TOperation, TErrorCode> > .Logger.Error("EnumProcessor : 오퍼레이션이 IErrorCode가 아닙니다.");

                base.Result = false;
            }
            else if (!(base.Feedback is int))
            {
                op.ErrorCode = this.DefaultValue;
                if (base.Feedback is OkMessage)
                {
                    base.Result = true;
                }
                else if (base.Feedback is FailMessage)
                {
                    base.Result = false;
                }
                else
                {
                    base.Result = false;
                    Log <EnumProcessor <TOperation, TErrorCode> > .Logger.Error("EnumProcessor : int 혹은 OkMessage, FailMessage만 받을 수 있습니다.");
                }
            }
            else
            {
                op.ErrorCode = (TErrorCode)((object)Enum.ToObject(typeof(TErrorCode), (int)base.Feedback));
                base.Result  = false;
                yield return(null);

                base.Result = (base.Feedback is OkMessage);
            }
            yield break;
        }
Exemple #7
0
 internal P_ExceptionData(P_ExceptionData source = default, ArgumentPlaceholder <IErrorCode> errorCode = default, ArgumentPlaceholder <bool> isObserved = default)
 {
     _errorCode  = errorCode.HasExplicitValue ? errorCode.ExplicitValue : source?._errorCode;
     _isObserved = isObserved.HasExplicitValue ? isObserved.ExplicitValue : (source?._isObserved ?? false);
 }
Exemple #8
0
 public Error(IErrorCode errorCode, string errorMessage)
 {
     ErrorCode    = errorCode;
     ErrorMessage = errorMessage;
 }
Exemple #9
0
 public DataSyncException(IErrorCode errorCode, string msg) : base(msg)
 {
     ErrorCode = errorCode;
 }