All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.deepl.api.ConnectionException Maven / Gradle / Ivy

The newest version!
// Copyright 2022 DeepL SE (https://www.deepl.com)
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
package com.deepl.api;

/** Exception thrown when a connection error occurs while accessing the DeepL API. */
public class ConnectionException extends DeepLException {
  private final boolean shouldRetry;

  public ConnectionException(String message, boolean shouldRetry, Throwable cause) {
    super(message, cause);
    this.shouldRetry = shouldRetry;
  }

  /**
   * Returns true if this exception occurred due to transient condition and the request
   * should be retried, otherwise false.
   */
  public boolean getShouldRetry() {
    return shouldRetry;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy