diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/exceptions/CryptoFailedException.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/exceptions/CryptoFailedException.java index 4e452af44..2b2978f50 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/exceptions/CryptoFailedException.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/exceptions/CryptoFailedException.java @@ -1,6 +1,6 @@ /** * - * Copyright 2017 Paul Schaub + * Copyright 2017 Paul Schaub, 2021 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,6 @@ */ package org.jivesoftware.smackx.omemo.exceptions; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * Exception gets thrown when some cryptographic function failed. * @@ -27,20 +23,18 @@ import java.util.List; */ public class CryptoFailedException extends Exception { - private static final long serialVersionUID = 3466888654338119924L; + private static final long serialVersionUID = 1; - private final ArrayList exceptions = new ArrayList<>(); + public CryptoFailedException(String message, Exception wrappedException) { + super(message, wrappedException); + } public CryptoFailedException(String message) { - super(message); + this(message, null); } public CryptoFailedException(Exception e) { - super(e); - exceptions.add(e); + this("Crypto failed " + e.getMessage(), e); } - public List getExceptions() { - return Collections.unmodifiableList(exceptions); - } }