---
title: "setException(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webscriptobject/setexception(_:)"
---

# setException(_:)

Raises a scripting environment exception in the context of the current object.

## Declaration

```swift
func setException(_ description: String!)
```

## Parameters

- `description`: Description of the exception.

## See Also

### Raising exceptions

- [throwException(_:)](webkit/webscriptobject/throwexception(_:).md)
