Describes a failure to read a glTF asset.
glTF documents reference each other by index — an accessor names a buffer view, which names a buffer — so a broken file usually means one index in that chain is wrong. Errors therefore carry which index of what, since "invalid glTF" is not something anyone can act on.
Summary
Functions
Builds an error.
Types
@type kind() ::
:not_gltf
| :bad_json
| :bad_glb
| :unsupported_version
| :missing
| :bad_reference
| :unsupported
| :buffer_unavailable
| :truncated
What went wrong:
:not_gltf— the input is neither JSON nor a GLB container:bad_json— the JSON document could not be parsed:bad_glb— the binary container is malformed:unsupported_version— the asset declares a version this cannot read:missing— a referenced index or required field is absent:bad_reference— an index points outside its collection:unsupported— a valid construct this library does not implement:buffer_unavailable— buffer data could not be resolved:truncated— a view or accessor reaches past the end of its buffer
@type t() :: %Gltf.Error{ __exception__: true, detail: String.t() | nil, index: non_neg_integer() | nil, kind: kind(), path: String.t() | nil }