# 8.1.0 Try function in expression not returning fallback on error

**URL:** <https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [November 11, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563 "2020-11-11T21:40:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 11, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563/1 "2020-11-11T21:40:54Z")

</div>

v8.1.0

Below, `view.params.icon.path` doesn’t exist and I want to return false if this is the case. I tried using the `try` function, but it’s returning bad\_stale instead of false.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/a/dadef39458260c1bd94c86b36f3a62033b121ad0.png)

I’ll use `isGood` instead (probably should use that anyway)

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [February 17, 2021, 10:27pm UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563/2 "2021-02-17T22:27:02Z")

</div>

Is this fixed in 8.1.2?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 17, 2021, 10:44pm UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563/3 "2021-02-17T22:44:19Z")

</div>

From Dev:  
This is not a bug - it is expected behavior.  
`Good`, `Uncertain`, and `Bad` qualities are all passed through as non-error or non-exception values; only qualities which fall under `Error` result in an “exception” state and therefore return the failover value.

So @nminchin is correct in that the property should be verified as `isGood` because that is more correct.

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [February 18, 2021, 3:48am UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563/4 "2021-02-18T03:48:33Z")

</div>

Thanks for the clarification, @cmallonee. I can see where you’re coming from, it’s just that with the failover the code is so much more efficient.

```auto
try(tag({view.params.tagPath}+'/Name'),{view.params.label})

```

…is nice because you only enter the path once, but unfortunately yields `Bad_NotFound`, while

```auto
if(isGood(tag({view.params.TagPath}+'/Name')),tag({view.params.TagPath}+'/Name'),{view.params.label})

```

…just seems a bit repetitious to me.

Wouldn’t `Bad_NotFound` be somewhat synonymous with an error?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 18, 2021, 4:52am UTC](https://forum.inductiveautomation.com/t/8-1-0-try-function-in-expression-not-returning-fallback-on-error/40563/5 "2021-02-18T04:52:41Z")

</div>

The absence of something does not mean there’s an error. Perspective properties which do not persist fall into this category.

The following cherry-picked expression references a key which is not Persistent.

```auto
try({this.custom.myKey}, false)

```

When the property is in place, the expression reads the property and returns the value. Now we know that the fallback in this situation will never be used because we’ll pass-through the `Bad_Stale` quality, but the point is that the lack of a property does not mean there is an error or exception - only that the property is not yet in place.

And I’m not saying there isn’t a valid gripe about having to check the quality of something before returning it, but this isn’t new behavior. Also, Expression Transforms can help reduce this a bit.

 ![Screen Shot 2021-02-17 at 8.52.17PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/f/7f5c26fd3e4498b4b9cdcefbfdc519ecc233a7c6.png)
