# `BeamExport.EncodeError`
[🔗](https://github.com/HataluliRandima/beam_export/blob/v0.1.0/lib/beam_export/errors.ex#L101)

Raised (or returned) when a record or value cannot be turned into CSV without
losing or inventing data.

BeamExport refuses to guess: lists, maps, tuples and other values without an
obvious text form must be converted explicitly in your `:mapper`, and headers
must match the records they extract from. The message never includes record
values, only types, positions and header names.

Fields:

  * `:reason` - one of:
    * `{:unsupported_value, type}` - a field value has no CSV representation.
    * `{:invalid_row, type}` - a record is not a list, tuple, map or struct.
    * `:map_without_headers` - a map/struct record without `:headers` or `:mapper`.
    * `{:unknown_header, header, struct_module}` - a header is not a field of the struct.
    * `{:no_matching_headers, headers}` - none of the headers is a key of the map.
  * `:row` - 1-based data row (header row not counted), or `nil` for the header row.
  * `:column` - 1-based column, when known.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
