# Sol.retcode != :Success not working inside turing model

**URL:** <https://discourse.julialang.org/t/sol-retcode-success-not-working-inside-turing-model/99438>\
**Category:** New to Julia\
**Tags:** question, ode, turing, differentialequation\
**Created:** [May 26, 2023, 10:28am UTC](https://discourse.julialang.org/t/sol-retcode-success-not-working-inside-turing-model/99438 "2023-05-26T10:28:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [May 26, 2023, 10:28am UTC](https://discourse.julialang.org/t/sol-retcode-success-not-working-inside-turing-model/99438/1 "2023-05-26T10:28:42Z")

</div>

I’m using `sol.retcode != :Success` to check my model solution but it throws this error.

```julia
nested task error: type TrackedArray has no field retcode

```

Can someone tell me what can be other way to use sol.retcode ?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 26, 2023, 12:58pm UTC](https://discourse.julialang.org/t/sol-retcode-success-not-working-inside-turing-model/99438/2 "2023-05-26T12:58:11Z")

</div>

Repost. See the documentation:

[https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes)

The recommended form is `SciMLBase.successful_retcode(sol.retcode)` since that covers more than just `ReturnCode.Success`.
