Package org.apache.sling.resourceresolver.impl.helper

# Class URIException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.sling.api.SlingException
org.apache.sling.resourceresolver.impl.helper.URIException

All Implemented Interfaces:
  `Serializable`

public class URIException extends org.apache.sling.api.SlingException
The URI parsing and escape encoding exception.

This class is a slightly modified version of the URIException class distributed with Http Client 3.1. The changes are removal of deprecated methods and have the class itself extend the `SlingException` to adapt it to the exception hierarchy of Sling.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ESCAPING`
The URI escape encoding and decoding error.
`static final int`
`PARSING`
The URI parsing error.
`static final int`
`PUNYCODE`
The DNS punycode encoding or decoding error.
`protected String`
`reason`
The reason message.
`protected int`
`reasonCode`
The reason code.
`static final int`
`UNKNOWN`
No specified reason code.
`static final int`
`UNSUPPORTED_ENCODING`
The unsupported character encoding.

## Constructor Summary

Constructors
Constructor
Description
`URIException()`
Default constructor.
`URIException(int reasonCode)`
The constructor with a reason code argument.
`URIException(int reasonCode, String reason)`
The constructor with a reason string and its code arguments.
`URIException(String reason)`
The constructor with a reason string argument.

## Method Summary

Modifier and Type
Method
Description
`int`
`getReasonCode()`
Get the reason code.

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### UNKNOWN

public static final int UNKNOWN
No specified reason code.

See Also:
  - Constant Field Values

### PARSING

public static final int PARSING
The URI parsing error.

See Also:
  - Constant Field Values

### UNSUPPORTED_ENCODING

public static final int UNSUPPORTED_ENCODING
The unsupported character encoding.

See Also:
  - Constant Field Values

### ESCAPING

public static final int ESCAPING
The URI escape encoding and decoding error.

See Also:
  - Constant Field Values

### PUNYCODE

public static final int PUNYCODE
The DNS punycode encoding or decoding error.

See Also:
  - Constant Field Values

### reasonCode

protected int reasonCode
The reason code.

### reason

protected String reason
The reason message.

## Constructor Details

### URIException

public URIException()
Default constructor.

### URIException

public URIException(int reasonCode)
The constructor with a reason code argument.

Parameters:
  `reasonCode` - the reason code

### URIException

public URIException(int reasonCode, String reason)
The constructor with a reason string and its code arguments.

Parameters:
  `reasonCode` - the reason code
  `reason` - the reason

### URIException

public URIException(String reason)
The constructor with a reason string argument.

Parameters:
  `reason` - the reason

## Method Details

### getReasonCode

public int getReasonCode()
Get the reason code.

Returns:
  the reason code