1 package com.atlassian.plugin.exception;
2
3 import com.atlassian.annotations.Internal;
4 import com.atlassian.plugin.Plugin;
5
6 /**
7 * This allows the Host application to intercept a plugin exception and do something meaningful with it. Its is not
8 * intended for plugin developers to consume at all.
9 *
10 * @since v3.0
11 */
12 @Internal
13 public interface PluginExceptionInterception
14 {
15 /**
16 * This is called when a plugin cant be enabled because an exception has been thrown.
17 * <p/>
18 * This is an intercept point for the host to do something meaningful like better logging or failed plugin
19 * tracking.
20 * <p/>
21 * It must NOT propagate the exception out of this block because this will stop the plugin system in general for
22 * starting.
23 *
24 * @param plugin the plugin that has failed to be enabled
25 * @param pluginException the exception that was thrown during plugin enable
26 * @return true if the underlying plugin system should log a message. If this is false then the assumption is that
27 * host application has done the appropriate logging
28 */
29 boolean onEnableException(Plugin plugin, Exception pluginException);
30 }