---
title: EncodingError
framework: swift
role: symbol
role_heading: Enumeration
path: swift/encodingerror
---

# EncodingError

An error that occurs during the encoding of a value.

## Declaration

```swift
enum EncodingError
```

## Topics

### Structures

- [EncodingError.Context](swift/encodingerror/context.md)

### Enumeration Cases

- [EncodingError.invalidValue(_:_:)](swift/encodingerror/invalidvalue(_:_:).md)

### Default Implementations

- [CustomDebugStringConvertible Implementations](swift/encodingerror/customdebugstringconvertible-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Error](swift/error.md)
- [Escapable](swift/escapable.md)
- [LocalizedError](foundation/localizederror.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Encoders and Decoders

- [Encoder](swift/encoder.md)
- [Decoder](swift/decoder.md)
- [DecodingError](swift/decodingerror.md)
