Error() public method

public Error ( Action configure ) : void
configure Action
return void
コード例 #1
0
 private void duplicateDirective(ValidationTestConfig _, string directiveName, int line, int column)
 {
     _.Error(err =>
     {
         err.Message = $"The directive '{directiveName}' can only be used once at this location.";
         err.Loc(line, column);
     });
 }
コード例 #2
0
 private void missingDirectiveArg(
     ValidationTestConfig _,
     string directiveName,
     string argName,
     string typeName,
     int line,
     int column)
 {
     _.Error(Rule.MissingDirectiveArgMessage(directiveName, argName, typeName), line, column);
 }
コード例 #3
0
 private void missingDirectiveArg(
     ValidationTestConfig _,
     string directiveName,
     string argName,
     string typeName,
     int line,
     int column)
 {
     _.Error(ProvidedNonNullArgumentsError.MissingDirectiveArgMessage(directiveName, argName, typeName), line, column);
 }
コード例 #4
0
 private void missingFieldArg(
     ValidationTestConfig _,
     string fieldName,
     string argName,
     string typeName,
     int line,
     int column)
 {
     _.Error(Rule.MissingFieldArgMessage(fieldName, argName, typeName), line, column);
 }
コード例 #5
0
 private void undefFrag(
     ValidationTestConfig _,
     string fragName,
     int line,
     int column)
 {
     _.Error(err =>
     {
         err.Message = Rule.UnknownFragmentMessage(fragName);
         err.Loc(line, column);
     });
 }
コード例 #6
0
 private void unusedFrag(
     ValidationTestConfig _,
     string varName,
     int line,
     int column
     )
 {
     _.Error(err =>
     {
         err.Message = Rule.UnusedFragMessage(varName);
         err.Loc(line, column);
     });
 }
コード例 #7
0
 private void unusedVar(
     ValidationTestConfig _,
     string varName,
     string opName,
     int line,
     int column
     )
 {
     _.Error(err =>
     {
         err.Message = NoUnusedVariablesError.UnusedVariableMessage(varName, opName);
         err.Loc(line, column);
     });
 }
コード例 #8
0
        private void undefinedField(
            ValidationTestConfig _,
            string field,
            string type,
            IEnumerable <string> suggestedTypes  = null,
            IEnumerable <string> suggestedFields = null,
            int line   = 0,
            int column = 0)
        {
            suggestedTypes  = suggestedTypes ?? Enumerable.Empty <string>();
            suggestedFields = suggestedFields ?? Enumerable.Empty <string>();

            _.Error(Rule.UndefinedFieldMessage(field, type, suggestedTypes, suggestedFields), line, column);
        }
コード例 #9
0
 private void duplicateDirective(
     ValidationTestConfig _,
     string directiveName,
     int line1,
     int column1,
     int line2,
     int column2)
 {
     _.Error(err =>
     {
         err.Message = Rule.DuplicateDirectiveMessage(directiveName);
         err.Loc(line1, column1);
         err.Loc(line2, column2);
     });
 }
コード例 #10
0
 private void duplicateArg(
     ValidationTestConfig _,
     string argName,
     int line1,
     int column1,
     int line2,
     int column2)
 {
     _.Error(err =>
     {
         err.Message = UniqueArgumentNamesError.DuplicateArgMessage(argName);
         err.Loc(line1, column1);
         err.Loc(line2, column2);
     });
 }
コード例 #11
0
 private void duplicateVariable(
     ValidationTestConfig _,
     string variableName,
     int line1,
     int column1,
     int line2,
     int column2)
 {
     _.Error(err =>
     {
         err.Message = UniqueVariableNamesError.DuplicateVariableMessage(variableName);
         err.Loc(line1, column1);
         err.Loc(line2, column2);
     });
 }
コード例 #12
0
 private void duplicateFrag(
     ValidationTestConfig _,
     string fragName,
     int line1,
     int column1,
     int line2,
     int column2)
 {
     _.Error(err =>
     {
         err.Message = Rule.DuplicateFragmentNameMessage(fragName);
         err.Loc(line1, column1);
         err.Loc(line2, column2);
     });
 }
コード例 #13
0
 private void undefVar(
     ValidationTestConfig _,
     string varName,
     int line1,
     int column1,
     string opName,
     int line2,
     int column2)
 {
     _.Error(err =>
     {
         err.Message = Rule.UndefinedVarMessage(varName, opName);
         err.Loc(line1, column1);
         err.Loc(line2, column2);
     });
 }
コード例 #14
0
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig config,
            string argName,
            string typeName,
            string value,
            int line,
            int column,
            IEnumerable <string> errors = null)
        {
            errors ??= new[] { $"Expected type \"{typeName}\", found {value}." };

            config.Error(
                ArgumentsOfCorrectTypeError.BadValueMessage(argName, value, errors),
                line,
                column);
        }
コード例 #15
0
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig config,
            string argName,
            string typeName,
            string value,
            int line,
            int column,
            string errors = null)
        {
            errors ??= $"Expected type '{typeName}', found {value}.";

            config.Error(
                ArgumentsOfCorrectTypeError.BadValueMessage(argName, errors),
                line,
                column);
        }
コード例 #16
0
        private void badValue(
            ValidationTestConfig _,
            string argName,
            string typeName,
            string value,
            int?line   = null,
            int?column = null,
            IEnumerable <string> errors = null)
        {
            if (errors == null)
            {
                errors = new [] { $"Expected type \"{typeName}\", found {value}." };
            }

            _.Error(
                _rule.BadValueMessage(argName, null, value, errors),
                line,
                column);
        }
コード例 #17
0
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig _,
            string argName,
            string typeName,
            string value,
            int?line   = null,
            int?column = null,
            IEnumerable <string> errors = null)
        {
            if (errors == null)
            {
                errors = new [] { $"Expected type \"{typeName}\", found {value}." };
            }

            _.Error(
                rule.BadValueMessage(argName, null, value, errors),
                line,
                column);
        }
コード例 #18
0
 private void error(ValidationTestConfig _, string fragName, string parentType, string fragType, int line, int column)
 {
     _.Error(PossibleFragmentSpreadsError.TypeIncompatibleSpreadMessage(fragName, parentType, fragType), line, column);
 }
コード例 #19
0
 private void misplacedDirective(ValidationTestConfig _, string name, DirectiveLocation placement, int line, int column)
 {
     _.Error($"Directive '{name}' may not be used on {placement}.", line, column);
 }
コード例 #20
0
 private void errorAnon(ValidationTestConfig _, string parentType, string fragType, int line, int column)
 {
     _.Error(Rule.TypeIncompatibleAnonSpreadMessage(parentType, fragType), line, column);
 }
コード例 #21
0
 private void unknownDirective(ValidationTestConfig _, string name, int line, int column)
 {
     _.Error($"Unknown directive '{name}'.", line, column);
 }
コード例 #22
0
 private void unknownDirective(ValidationTestConfig _, string name, int line, int column)
 {
     _.Error(Rule.UnknownDirectiveMessage(name), line, column);
 }
コード例 #23
0
 private void misplacedDirective(ValidationTestConfig _, string name, DirectiveLocation placement, int line, int column)
 {
     _.Error(Rule.MisplacedDirectiveMessage(name, placement.ToString()), line, column);
 }
コード例 #24
0
 private void error(ValidationTestConfig _, string fragName, string typeName, int line, int column)
 {
     _.Error(Rule.FragmentOnNonCompositeErrorMessage(fragName, typeName), line, column);
 }