<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Scripting Bridge",
  "identifier" : "/documentation/ScriptingBridge/SBObject/lastError()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Scripting Bridge"
    ],
    "preciseIdentifier" : "c:objc(cs)SBObject(im)lastError"
  },
  "title" : "lastError()"
}
-->

# lastError()

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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)