2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onosproject.pcepio.exceptions;
20 * Custom Exception for PCEP IO.
22 public class PcepParseException extends Exception {
24 private static final long serialVersionUID = 7960991379951448423L;
25 private byte errType = 0;
26 private byte errValue = 0;
29 * Default constructor to create a new exception.
31 public PcepParseException() {
36 * Constructor to create exception from message and cause.
38 * @param message the detail of exception in string
39 * @param cause underlying cause of the error
41 public PcepParseException(final String message, final Throwable cause) {
42 super(message, cause);
46 * Constructor to create exception from message.
48 * @param message the detail of exception in string
50 public PcepParseException(final String message) {
55 * Constructor to create exception from error type and error value.
57 * @param errType error type of pcep
58 * @param errValue error value of pcep
60 public PcepParseException(final byte errType, final byte errValue) {
62 this.errType = errType;
63 this.errValue = errValue;
67 * Constructor to create exception from cause.
69 * @param cause underlying cause of the error
71 public PcepParseException(final Throwable cause) {
76 * Returns error type for this exception.
80 public byte getErrorType() {
85 * Returns error value for this exception.
89 public byte getErrorValue() {