---
title: NSCoder.DecodingFailurePolicy.raiseException
framework: foundation
role: symbol
role_heading: Case
path: foundation/nscoder/decodingfailurepolicy-swift.enum/raiseexception
---

# NSCoder.DecodingFailurePolicy.raiseException

A failure policy that directs the coder to raise an exception.

## Declaration

```swift
case raiseException
```

## Discussion

Discussion With this policy, the NSCoder raises an exception internally to propagate failure messages (and unwind the stack). In Objective-C, this exception can be transformed into an NSError via methods like decodeTopLevelObjectAndReturnError:

## See Also

### Failure Policies

- [NSCoder.DecodingFailurePolicy.setErrorAndReturn](foundation/nscoder/decodingfailurepolicy-swift.enum/seterrorandreturn.md)
