Skip to main content
All docs
V26.1
  • CriteriaParserLimitException Class

    An exception that is thrown when a criteria string exceeds a criteria parser limit.

    Namespace: DevExpress.Data.Filtering.Exceptions

    Assembly: DevExpress.Data.v26.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public class CriteriaParserLimitException :
        CriteriaParserException

    Remarks

    The criteria parser throws this exception when a criteria string exceeds one of the following limits:

    Use the Kind property to identify the exceeded limit.

    CriteriaParserLimitException derives from CriteriaParserException. Existing parser error handlers also handle limit violations.

    Treat a criteria string that exceeds a limit as invalid input and reject it. Raise or disable parser limits to accept these strings only after you verify that your application can safely process larger input.

    The following example rejects criteria strings that exceed parser limits:

    using DevExpress.Data.Filtering;
    using DevExpress.Data.Filtering.Exceptions;
    
    try {
        CriteriaOperator criteria = CriteriaOperator.Parse(userInput);
        // Use the criteria.
    }
    catch(CriteriaParserLimitException e) {
        // e.Kind returns CriteriaParserLimitKind.Depth, Operands, or Tokens.
        // The input exceeds a limit. Reject it.
    }
    catch(CriteriaParserException) {
        // The input is not a valid criteria string. Reject it.
    }
    

    For additional information, refer to the following help topic: Criteria String Parsing and Untrusted Input.

    Inheritance

    Object
    Exception
    CriteriaParserException
    CriteriaParserLimitException
    See Also