---
title: saveAndReturnError()
framework: addressbook
role: symbol
role_heading: Instance Method
path: addressbook/abaddressbook/saveandreturnerror()
---

# saveAndReturnError()

Saves all the changes made since the last save.

## Declaration

```swift
func saveAndReturnError() throws
```

## Discussion

Discussion note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Saving and Detecting Changes

- [hasUnsavedChanges()](addressbook/abaddressbook/hasunsavedchanges().md)
- [save()](addressbook/abaddressbook/save().md)
