1 /*
2 * This file is part of dependency-check-core.
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 *
16 * Copyright (c) 2016 Jeremy Long. All Rights Reserved.
17 */
18 package org.owasp.dependencycheck.exception;
19
20 import javax.annotation.concurrent.ThreadSafe;
21
22 /**
23 * An exception used when initializing analyzers.
24 *
25 * @author Jeremy Long
26 */
27 @ThreadSafe
28 public class InitializationException extends Exception {
29
30 /**
31 * The serial version UID for serialization.
32 */
33 private static final long serialVersionUID = 6034529098584358957L;
34
35 /**
36 * Whether or not the exception is fatal.
37 */
38 private boolean fatal = true;
39
40 /**
41 * Get the value of fatal.
42 *
43 * @return the value of fatal
44 */
45 public boolean isFatal() {
46 return fatal;
47 }
48
49 /**
50 * Set the value of fatal.
51 *
52 * @param fatal new value of fatal
53 */
54 public void setFatal(boolean fatal) {
55 this.fatal = fatal;
56 }
57
58 /**
59 * Creates a new InitializationException.
60 */
61 public InitializationException() {
62 super();
63 }
64
65 /**
66 * Creates a new InitializationException.
67 *
68 * @param msg a message for the exception.
69 */
70 public InitializationException(String msg) {
71 super(msg);
72 }
73
74 /**
75 * Creates a new InitializationException.
76 *
77 * @param ex the cause of the exception.
78 */
79 public InitializationException(Throwable ex) {
80 super(ex);
81 }
82
83 /**
84 * Creates a new InitializationException.
85 *
86 * @param msg a message for the exception.
87 * @param ex the cause of the exception.
88 */
89 public InitializationException(String msg, Throwable ex) {
90 super(msg, ex);
91 }
92
93 /**
94 * Creates a new InitializationException.
95 *
96 * @param msg a message for the exception.
97 * @param ex the cause of the exception.
98 * @param fatal whether or not the exception is fatal.
99 */
100 public InitializationException(String msg, Throwable ex, boolean fatal) {
101 super(msg, ex);
102 this.fatal = fatal;
103 }
104 }