/** * Adds keys to collection of failed keys. * * @param keys Key to add. * @param e Error cause. */ public synchronized void addFailedKeys(Collection<K> keys, Throwable e) { if (failedKeys == null) failedKeys = new ArrayList<>(keys.size()); failedKeys.addAll(keys); if (err == null) err = new GridException("Failed to update keys on primary node."); err.addSuppressed(e); }
/** * Adds key to collection of failed keys. * * @param key Key to add. * @param e Error cause. */ public synchronized void addFailedKey(K key, Throwable e) { if (failedKeys == null) failedKeys = new ConcurrentLinkedQueue<>(); failedKeys.add(key); if (err == null) err = new GridException("Failed to update keys on primary node."); err.addSuppressed(e); }
/** * Adds key to collection of failed keys. * * @param key Key to add. * @param e Error cause. */ public void addFailedKey(K key, Throwable e) { if (failedKeys == null) failedKeys = new ArrayList<>(); failedKeys.add(key); if (err == null) err = new GridException("Failed to update keys on primary node."); err.addSuppressed(e); }
/** * Creates {@code GridException} with the collection of suppressed exceptions. * * @param msg Message. * @param suppressed The collections of suppressed exceptions. * @return {@code GridException}. */ public static GridException exceptionWithSuppressed(String msg, @Nullable Collection<Throwable> suppressed) { GridException e = new GridException(msg); if (suppressed != null) { for (Throwable th : suppressed) e.addSuppressed(th); } return e; }
errs = new GridException("Multiple connection attempts failed."); errs.addSuppressed(e);
"[nodeId=" + node.id() + ", addrs=" + addrs + ']'); errs.addSuppressed(new GridException("Failed to connect to address: " + addr, e)); "[nodeId=" + node.id() + ", addrs=" + addrs + ']'); errs.addSuppressed(new GridException("Failed to connect to address: " + addr, e));