---
title: "EncodingError.invalidValue(_:_:)"
framework: swift
role: symbol
role_heading: Case
path: "swift/encodingerror/invalidvalue(_:_:)"
---

# EncodingError.invalidValue(_:_:)

An indication that an encoder or its containers could not encode the given value.

## Declaration

```swift
case invalidValue(Any, EncodingError.Context)
```

## Discussion

Discussion As associated values, this case contains the attempted value and context for debugging.
