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 * This is called when a plugin cant be enabled because an exception has been thrown.
16 * <p>
17 * This is an intercept point for the host to do something meaningful like better logging or failed plugin
18 * tracking.
19 * <p>
20 * It must NOT propagate the exception out of this block because this will stop the plugin system in general for
21 * starting.
22 *
23 * @param plugin the plugin that has failed to be enabled
24 * @param pluginException the exception that was thrown during plugin enable
25 * @return true if the underlying plugin system should log a message. If this is false then the assumption is that
26 * host application has done the appropriate logging
27 */
28 boolean onEnableException(Plugin plugin, Exception pluginException);
29 }