GetError() public method

Returns the error associated with getting the value. A null return value indicates that the default error message should be provided by the caller.
public GetError ( ActionBinder binder ) : ErrorInfo
binder ActionBinder
return ErrorInfo
示例#1
0
        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, DynamicMetaObject instance)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.GetValue(getMemInfo.ResolutionFactory, this, type);

            if (val != null)
            {
                getMemInfo.Body.FinishCondition(val);
            }
            else
            {
                ErrorInfo ei = tracker.GetError(this);
                if (ei.Kind != ErrorInfoKind.Success && getMemInfo.IsNoThrow)
                {
                    getMemInfo.Body.FinishError(MakeOperationFailed());
                }
                else
                {
                    getMemInfo.Body.FinishError(MakeError(tracker.GetError(this), typeof(object)));
                }
            }
        }
示例#2
0
        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, Expression instance)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.GetValue(getMemInfo.CodeContext, this, type);

            getMemInfo.Body.FinishCondition(
                val != null ?
                val :
                MakeError(tracker.GetError(this))
                );
        }
示例#3
0
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, DynamicMetaObject instance, DynamicMetaObject target, Type type, MemberTracker tracker, DynamicMetaObject errorSuggestion)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.SetValue(memInfo.ResolutionFactory, this, type, target, errorSuggestion);

            if (val != null)
            {
                memInfo.Body.FinishCondition(val);
            }
            else
            {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                    );
            }
        }
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, Expression instance, MetaObject target, Type type, MemberTracker tracker)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.SetValue(memInfo.CodeContext, this, type, target.Expression);

            if (val != null)
            {
                memInfo.Body.FinishCondition(val);
            }
            else
            {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this))
                    );
            }
        }
        private void MakeGenericBodyWorker(Type type, MemberTracker tracker, Expression instance)
        {
            if (!_isStatic)
            {
                tracker = tracker.BindToInstance(instance ?? Instance);
            }

            Expression val = tracker.GetValue(Binder, type);
            Statement  newBody;

            if (val != null)
            {
                newBody = Rule.MakeReturn(Binder, val);
            }
            else
            {
                newBody = tracker.GetError(Binder).MakeErrorForRule(Rule, Binder);
            }

            AddToBody(newBody);
        }
        private void MakeGenericBody(Type type, MemberTracker tracker)
        {
            if (!_isStatic)
            {
                tracker = tracker.BindToInstance(Instance);
            }

            Expression val = tracker.SetValue(Rule.Context, Binder, type, Rule.Parameters[1]);
            Expression newBody;

            if (val != null)
            {
                newBody = Rule.MakeReturn(Binder, val);
            }
            else
            {
                newBody = tracker.GetError(Binder).MakeErrorForRule(Rule, Binder);
            }

            AddToBody(newBody);
        }
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, Expression instance, DynamicMetaObject target, Type type, MemberTracker tracker) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.SetValue(memInfo.CodeContext, this, type, target.Expression);

            if (val != null) {
                memInfo.Body.FinishCondition(val);
            } else {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                );
            }
        }
        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, Expression instance) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.GetValue(getMemInfo.CodeContext, this, type);

            if (val != null) {
                getMemInfo.Body.FinishCondition(val);
            } else {
                ErrorInfo ei = tracker.GetError(this);
                if (ei.Kind != ErrorInfoKind.Success && getMemInfo.IsNoThrow) {
                    getMemInfo.Body.FinishCondition(MakeOperationFailed());
                } else {
                    getMemInfo.Body.FinishCondition(MakeError(tracker.GetError(this), typeof(object)));
                }
            }
        }
        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, Expression instance) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.GetValue(getMemInfo.CodeContext, this, type);

            getMemInfo.Body.FinishCondition(
                val != null ?
                    val :
                    MakeError(tracker.GetError(this))
            );
        }
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, DynamicMetaObject instance, DynamicMetaObject target, Type type, MemberTracker tracker, DynamicMetaObject errorSuggestion) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.SetValue(memInfo.ResolutionFactory, this, type, target, errorSuggestion);

            if (val != null) {
                memInfo.Body.FinishCondition(val);
            } else {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                );
            }
        }
示例#11
0
        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, DynamicMetaObject instance) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.GetValue(getMemInfo.ResolutionFactory, this, type);

            if (val != null) {
                getMemInfo.Body.FinishCondition(val);
            } else {
                ErrorInfo ei = tracker.GetError(this);
                if (ei.Kind != ErrorInfoKind.Success && getMemInfo.IsNoThrow) {
                    getMemInfo.Body.FinishError(MakeOperationFailed());
                } else {
                    getMemInfo.Body.FinishError(MakeError(tracker.GetError(this), typeof(object)));
                }
            }
        }