Use exceptions with explicit messages

This commit is contained in:
René Pfeuffer
2020-03-25 15:31:20 +01:00
parent af45388c27
commit 7247a81c9d
8 changed files with 104 additions and 20 deletions

View File

@@ -21,11 +21,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.plugin;
import static sonia.scm.ContextEntry.ContextBuilder.entity;
public class PluginDownloadException extends PluginInstallException {
public PluginDownloadException(String message, Throwable cause) {
super(message, cause);
public PluginDownloadException(AvailablePlugin plugin, Exception cause) {
super(entity("Plugin", plugin.getDescriptor().getInformation().getName()).build(), "failed to download plugin", cause);
}
@Override
public String getCode() {
return "9iRuFz1UB1";
}
}