# \#get

**URL:** https://discourse.julialang.org/tag/get/1924.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\`get()\` returns default value instead of value matching to valid key when default value is an \`error()\`](https://discourse.julialang.org/t/get-returns-default-value-instead-of-value-matching-to-valid-key-when-default-value-is-an-error/137670)

<div class="topic-metadata">

**Author:** [@jlawrie](https://discourse.julialang.org/u/jlawrie)\
**Replies:** 10\
**Last updated:** [June 19, 2026, 12:26pm UTC](https://discourse.julialang.org/t/get-returns-default-value-instead-of-value-matching-to-valid-key-when-default-value-is-an-error/137670 "2026-06-19T12:26:09Z")

</div>

Hello everyone! Looking at the MWE below: It appears error/throw are run before get is finished, causing get to be interrupted and the default value to be returned, rather than the value which matches the valid key as …
