# Setting path on an error

**URL:** <https://forum.elixirforum.com/t/setting-path-on-an-error/59857>\
**Category:** Questions\
**Tags:** errors, graphql, ash\
**Created:** [November 21, 2023, 1:55am UTC](https://forum.elixirforum.com/t/setting-path-on-an-error/59857 "2023-11-21T01:55:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rgraff](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rgraff/32/31993_2.png) [@rgraff](https://forum.elixirforum.com/u/rgraff)\
**Post date:** [November 22, 2023, 12:21am UTC](https://forum.elixirforum.com/t/setting-path-on-an-error/59857/3 "2023-11-22T00:21:15Z")

</div>

The path is being set correctly.

```elixir
      {:error,
       InvalidAttribute.exception(
         field: :variant_key,
         path: [:feature_override],
         message: "feature variant not found"
       )
       |> IO.inspect()}

%Ash.Error.Changes.InvalidAttribute{
  field: :variant_key,
  message: "feature variant not found",
  private_vars: nil,
  value: nil,
  changeset: nil,
  query: nil,
  error_context: [],
  vars: [],
  path: [:feature_override],
  stacktrace: #Stacktrace<>,
  class: :invalid
}

```

Using `Ash.Error.set_path(...)` adds to the path but it’s still not in the graphql fields.

Yesterday when I was digging I thought I remember seeing builtin errors from constraints also have keys `attribute:` and `resource:` but now I can’t recreate those.

---

_[View the full topic](https://forum.elixirforum.com/t/setting-path-on-an-error/59857)._
