# Ecto error handling: let exceptions bubble up?

**URL:** <https://forum.elixirforum.com/t/ecto-error-handling-let-exceptions-bubble-up/71753>\
**Category:** Questions\
**Tags:** ecto, error-handling, exceptions\
**Created:** [July 20, 2025, 5:04am UTC](https://forum.elixirforum.com/t/ecto-error-handling-let-exceptions-bubble-up/71753 "2025-07-20T05:04:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![camatcode](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/camatcode/32/38369_2.png) [@camatcode](https://forum.elixirforum.com/u/camatcode)\
**Post date:** [July 20, 2025, 5:27am UTC](https://forum.elixirforum.com/t/ecto-error-handling-let-exceptions-bubble-up/71753/2 "2025-07-20T05:27:29Z")

</div>

Let it crash.

The only time I can think of when I catch ecto errors like that is when I want an invalid UUID to be the same as a UUID that doesnt exist

```elixir
  @impl true
  def one(query, opts \\ []) do
    super(query, opts)
  rescue
    err in Ecto.Query.CastError ->
      if err.type == Ecto.UUID or match?({:in, Ecto.UUID}, err.type) do
        Logger.warning("Received invalid UUID #{err.value} in query #{inspect(query)}")
        nil
      else
        reraise err, __STACKTRACE__
      end
  end

```

---

_[View the full topic](https://forum.elixirforum.com/t/ecto-error-handling-let-exceptions-bubble-up/71753)._
