SplatTools.Error exception (SplatTools v0.1.2)

Copy Markdown View Source

Describes a failure to inspect, convert, or measure a splat asset.

Conversion failures are usually a missing tool or a rejected file rather than a bug, so the message is written for whoever has to fix it — including the command that was run, so it can be reproduced by hand.

Summary

Types

What went wrong

t()

Functions

Wraps a Ply.Error while keeping its message.

Builds an error.

Types

kind()

@type kind() ::
  :tool_missing
  | :not_a_splat
  | :invalid_ply
  | :conversion_failed
  | :timeout
  | :bad_output
  | :no_geometry
  | :bad_option

What went wrong:

  • :tool_missingsplat-transform is not installed
  • :not_a_splat — the file is not a Gaussian-splat point cloud
  • :invalid_ply — the file could not be read as PLY at all
  • :conversion_failed — the external tool ran and returned an error
  • :timeout — the external tool exceeded its time budget
  • :bad_output — the tool succeeded but produced nothing usable
  • :no_geometry — the file has no points to measure or frame
  • :bad_option — an option was outside the range it is defined for

t()

@type t() :: %SplatTools.Error{
  __exception__: true,
  command: String.t() | nil,
  detail: String.t() | nil,
  exit_status: integer() | nil,
  kind: kind(),
  output: String.t() | nil
}

Functions

from_ply(error)

@spec from_ply(Exception.t()) :: t()

Wraps a Ply.Error while keeping its message.

The underlying reader already reports byte offsets and property names; discarding that in favour of "invalid file" would throw away the only actionable part.

new(kind, opts \\ [])

@spec new(
  kind(),
  keyword()
) :: t()

Builds an error.