Bug 1029: Remove dead code: samples/clustersession
[controller.git] / opendaylight / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / query / QueryException.java
1 /**
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.northbound.commons.query;
9
10 import javax.ws.rs.WebApplicationException;
11 import javax.ws.rs.core.MediaType;
12 import javax.ws.rs.core.Response;
13
14 /**
15  * Signals that an error happened during the parsing or processing of a query.
16  */
17 public class QueryException extends WebApplicationException {
18
19     private static final long serialVersionUID = 1L;
20
21     public QueryException(String msg) {
22         super(Response.status(Response.Status.BAD_REQUEST)
23                 .entity(msg).type(MediaType.TEXT_PLAIN).build());
24     }
25
26     public QueryException(String msg, Throwable cause) {
27         super(cause, Response.status(Response.Status.BAD_REQUEST)
28                 .entity(msg).type(MediaType.TEXT_PLAIN).build());
29     }
30 }