---
title: "throwException(_:)"
framework: webkit
role: symbol
role_heading: Type Method
path: "webkit/webscriptobject/throwexception(_:)"
---

# throwException(_:)

Raises an exception in the current script execution context.

## Declaration

```swift
class func throwException(_ exceptionMessage: String!) -> Bool
```

## Parameters

- `exceptionMessage`: The exception message.

## Return Value

Return Value true if successful, false otherwise.

## See Also

### Raising exceptions

- [setException(_:)](webkit/webscriptobject/setexception(_:).md)
