Partager via


ResourceNotFoundException Class

public class ResourceNotFoundException
extends HttpResponseException

The ResourceNotFoundException represents an exception thrown when an HTTP request attempts to access a resource that does not exist.

This exception is typically thrown when the service responds with a status code of 4XX, typically 404 Not Found.

This class also provides methods to get the HttpResponse that was received when the exception occurred and the deserialized HTTP response value.

Constructor Summary

Constructor Description
ResourceNotFoundException(String message, HttpResponse response)

Initializes a new instance of the ResourceNotFoundException class.

ResourceNotFoundException(String message, HttpResponse response, Object value)

Initializes a new instance of the ResourceNotFoundException class.

ResourceNotFoundException(String message, HttpResponse response, Throwable cause)

Initializes a new instance of the ResourceNotFoundException class.

Methods inherited from HttpResponseException

Methods inherited from java.lang.Object

Methods inherited from java.lang.Throwable

Constructor Details

ResourceNotFoundException

public ResourceNotFoundException(String message, HttpResponse response)

Initializes a new instance of the ResourceNotFoundException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response

ResourceNotFoundException

public ResourceNotFoundException(String message, HttpResponse response, Object value)

Initializes a new instance of the ResourceNotFoundException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response
value - the deserialized response value

ResourceNotFoundException

public ResourceNotFoundException(String message, HttpResponse response, Throwable cause)

Initializes a new instance of the ResourceNotFoundException class.

Parameters:

message - the exception message or the response content if a message is not available
response - the HTTP response
cause - the Throwable which caused the creation of this ResourceNotFoundException

Applies to