---
title: lastError()
framework: Scripting Bridge
role: symbol
role_heading: Instance Method
platforms: [macOS 10.6+]
path: scriptingbridge/sbobject/lasterror()
---

# lastError()

The error from the last event this object sent, or nil if it succeeded.

## Declaration

```swift
func lastError() -> (any Error)?
```
