# `BB.Error.Kinematics.NoParentJoint`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/error/kinematics/no_parent_joint.ex#L5)

A link has no parent joint because it is the root of the kinematic tree.

Distinct from `BB.Error.Kinematics.UnknownLink` on purpose. The root link
having no parent joint is a true structural fact, not a typo, so a caller
walking up the tree gets a termination signal it can match on rather than
being told its perfectly valid root link doesn't exist:

    defp ancestors(robot, link, acc) do
      case BB.Robot.parent_joint(robot, link) do
        {:ok, joint} -> ancestors(robot, joint.parent_link, [joint | acc])
        {:error, %NoParentJoint{}} -> {:ok, acc}
        {:error, reason} -> {:error, reason}
      end
    end

# `t`

```elixir
@type t() :: %BB.Error.Kinematics.NoParentJoint{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  link: atom(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %BB.Error.Kinematics.NoParentJoint{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  link: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.BB.Error.Kinematics.NoParentJoint` without raising it.

## Keys

- :link

---

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