blob: 986b50a3b936057b0d63a9a0cd287c55ee6fadf7 [file] [log] [blame]
Satish Kebe203d2015-11-21 15:58:18 +05301/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.ovsdb.rfc.exception;
17
18import static com.google.common.base.MoreObjects.toStringHelper;
19
20/**
21 * This exception is thrown when Bridge creation fails.
22 */
23public class BridgeCreateException extends RuntimeException {
24 private static final long serialVersionUID = 1377521646616825676L;
25
26 /**
27 * Constructs a BridgeCreateException object.
28 * @param message error message
29 */
30 public BridgeCreateException(String message) {
31 super(message);
32 }
33
34 /**
35 * Constructs a BridgeCreateException object.
36 * @param message error message
37 * @param cause Throwable
38 */
39 public BridgeCreateException(String message, Throwable cause) {
40 super(message, cause);
41 }
42
43 /**
44 * Create error message.
45 * @param ovsUuid ovs uuid name
46 * @return message
47 */
48 public static String createMessage(String ovsUuid) {
49 String message = toStringHelper("BridgeCreateException")
50 .addValue("Create new bridge failed for " + ovsUuid).toString();
51 return message;
52 }
53}