5a40a1861bdaa898b9c38c0b98005ceb22aca7cf
[controller.git] / opendaylight / networkconfiguration / neutron / northbound / src / main / java / org / opendaylight / controller / networkconfig / neutron / northbound / InternalServerErrorException.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.networkconfig.neutron.northbound;
10
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.Response;
13 import javax.ws.rs.core.MediaType;
14
15 /**
16  * Status Code 500 (Internal Server Error)
17  *
18  * The server encountered an unexpected condition which prevented
19  * it from fulfilling the request.
20  *
21  *
22  *
23  */
24 public class InternalServerErrorException extends WebApplicationException {
25     private static final long serialVersionUID = 1L;
26
27     /**
28      * Constructor for the INTERNAL_SERVER_ERROR custom handler
29      *
30      * @param string Error message to specify further the
31      * INTERNAL_SERVER_ERROR response
32      *
33      */
34     public InternalServerErrorException(String string) {
35         super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
36                 string).type(MediaType.TEXT_PLAIN).build());
37     }
38 }