/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.accumulo.access;

import java.util.regex.PatternSyntaxException;

/**
 * An exception that is thrown when an access expression is not correct.
 *
 * @since 1.0.0
 */
public final class IllegalAccessExpressionException extends PatternSyntaxException {
  private static final long serialVersionUID = 1L;

  public IllegalAccessExpressionException(String desc, String badarg, int index) {
    super(desc, badarg, index);
  }
}
