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

com.contentful.java.cda.CDAResourceNotFoundException Maven / Gradle / Ivy

package com.contentful.java.cda;

import java.util.Locale;

/**
 * RuntimeException indicating a resource was not found on Contentful.
 */
public class CDAResourceNotFoundException extends RuntimeException {

  /**
   * Create a new exception
   *
   * @param resourceType the type of the resource not found (Entry,Asset,Space)
   * @param resourceId   the actual id of the resource not found.
   */
  public CDAResourceNotFoundException(
      Class resourceType,
      String resourceId) {
    super(String.format(
        Locale.getDefault(), "Could not find id '%s' of type '%s'.",
        resourceId,
        resourceType.getSimpleName())
    );
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy