---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# URIError

The **`URIError()`** constructor creates an error when a global
URI handling function was used in a wrong way.

## Syntax

```js
new URIError()
new URIError(message)
new URIError(message, options)
new URIError(message, fileName)
new URIError(message, fileName, lineNumber)

URIError()
URIError(message)
URIError(message, options)
URIError(message, fileName)
URIError(message, fileName, lineNumber)
```

> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance.

### Parameters

- `message` _**optional**_
  - : Human-readable description of the error.
- `options` _**optional**_
  - : An object that has the following properties:
    - `cause` _**optional**_
      - : A property indicating the specific cause of the error.
        When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error.
