/** * Copyright (C) 2014-2016 Open Whisper Systems * * Licensed according to the LICENSE file in this repository. */ package org.whispersystems.signalservice.api.push.exceptions; import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException; import java.util.LinkedList; import java.util.List; public class EncapsulatedExceptions extends Throwable { private final List untrustedIdentityExceptions; private final List unregisteredUserExceptions; private final List networkExceptions; public EncapsulatedExceptions(List untrustedIdentities, List unregisteredUsers, List networkExceptions) { this.untrustedIdentityExceptions = untrustedIdentities; this.unregisteredUserExceptions = unregisteredUsers; this.networkExceptions = networkExceptions; } public EncapsulatedExceptions(UntrustedIdentityException e) { this.untrustedIdentityExceptions = new LinkedList<>(); this.unregisteredUserExceptions = new LinkedList<>(); this.networkExceptions = new LinkedList<>(); this.untrustedIdentityExceptions.add(e); } public List getUntrustedIdentityExceptions() { return untrustedIdentityExceptions; } public List getUnregisteredUserExceptions() { return unregisteredUserExceptions; } public List getNetworkExceptions() { return networkExceptions; } }