2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.northbound.commons.query;
10 import javax.ws.rs.WebApplicationException;
11 import javax.ws.rs.core.MediaType;
12 import javax.ws.rs.core.Response;
15 * Signals that an error happened during the parsing or processing of a query.
17 public class QueryException extends WebApplicationException {
19 private static final long serialVersionUID = 1L;
21 public QueryException(String msg) {
22 super(Response.status(Response.Status.BAD_REQUEST)
23 .entity(msg).type(MediaType.TEXT_PLAIN).build());
26 public QueryException(String msg, Throwable cause) {
27 super(cause, Response.status(Response.Status.BAD_REQUEST)
28 .entity(msg).type(MediaType.TEXT_PLAIN).build());