---
title: lastError()
framework: securityinterface
role: symbol
role_heading: Instance Method
path: securityinterface/sfauthorizationpluginview/lasterror()
---

# lastError()

Returns the last error that occurred during evaluation.

## Declaration

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

## Discussion

Discussion Your authorization plug-in should override this method and return the last error that occurred during evaluation or nil if no error occurred. A downstream plug-in can set a context value using the kAuthorizationContextFlagSticky flag to make it available to the SFAuthorizationPluginView class in case of an error.

## See Also

### Getting Instance Information

- [callbacks()](securityinterface/sfauthorizationpluginview/callbacks().md)
- [engineRef()](securityinterface/sfauthorizationpluginview/engineref().md)
