Last change
on this file since 9072 was 8308, checked in by Don-vip, 9 years ago |
fix potential NPEs and Sonar issues related to serialization
|
-
Property svn:eol-style
set to
native
|
File size:
1.0 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.plugins;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Exception that wraps any exception thrown by plugins. It is used in the JOSM main system
|
---|
8 | * and there is no particular reason to use this within the plugin itself (although there
|
---|
9 | * is also no reason against this.. ;)
|
---|
10 | *
|
---|
11 | * @author Immanuel.Scholz
|
---|
12 | */
|
---|
13 | public class PluginException extends Exception {
|
---|
14 | public final transient PluginProxy plugin;
|
---|
15 | public final String name;
|
---|
16 |
|
---|
17 | public PluginException(PluginProxy plugin, String name, Throwable cause) {
|
---|
18 | super(tr("An error occurred in plugin {0}", name), cause);
|
---|
19 | this.plugin = plugin;
|
---|
20 | this.name = name;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public PluginException(String name, String message) {
|
---|
24 | super(message);
|
---|
25 | this.plugin = null;
|
---|
26 | this.name = name;
|
---|
27 | }
|
---|
28 |
|
---|
29 | public PluginException(String name, Throwable cause) {
|
---|
30 | super(tr("An error occurred in plugin {0}", name), cause);
|
---|
31 | this.plugin = null;
|
---|
32 | this.name = name;
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.