Describes a failure to read or write a PLY file.
Errors carry the byte offset where the problem was found, plus the
element, row, and property when known. On a gigabyte file, knowing a
float was malformed at byte 900,000,000 in row 3,600,000 of vertex is
the difference between a fixable report and a shrug.
This struct is also an exception, so the same value can be returned from
Ply.read/2 or raised by Ply.read!/2.
Summary
Functions
Builds an error.
Types
@type kind() ::
:not_ply
| :bad_header
| :unknown_type
| :unsupported_format
| :truncated
| :bad_value
| :invalid_list_count
| :variable_width
| :no_such_element
| :no_such_property
| :count_mismatch
| :trailing_data
| :io_error
What went wrong:
:not_ply— the file does not begin with the PLY magic number:bad_header— the header is malformed or contains an unknown directive:unknown_type— a property declares a type name we do not recognise:unsupported_format— the format line is not one of the three PLY formats:truncated— the data ends before the declared counts are satisfied:bad_value— a value could not be decoded (malformed ASCII number, …):invalid_list_count— a list length exceeds the bytes remaining:variable_width— an operation requiring fixed-width rows hit a list property:no_such_element— the requested element is not present in the file:no_such_property— the requested property is not present in the element:count_mismatch— supplied rows disagree with the count the header declares:trailing_data— data remains after every declared element was read:io_error— the file could not be opened or read
@type t() :: %Ply.Error{ __exception__: true, detail: String.t() | nil, element: String.t() | nil, kind: kind(), offset: non_neg_integer() | nil, property: String.t() | nil, row: non_neg_integer() | nil }