# Handling CPE faults

**URL:** <https://forum.genieacs.com/t/handling-cpe-faults/743>\
**Category:** Uncategorized\
**Created:** [April 27, 2020, 9:34am UTC](https://forum.genieacs.com/t/handling-cpe-faults/743 "2020-04-27T09:34:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavira](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lavira](https://forum.genieacs.com/u/lavira)\
**Post date:** [April 27, 2020, 9:34am UTC](https://forum.genieacs.com/t/handling-cpe-faults/743/1 "2020-04-27T09:34:48Z")

</div>

Is there a way to handle device faults? I have some devices which accept setting a parameter as boolean and other that require int.  
I want to handle this if it’s possible with something like try/catch, for ex:

> try {  
> declare(‘path’, null, {value: [true, “xsd:boolean”]});  
> } catch (err) {  
> declare(‘path’, null, {value: [1, “xsd:int”]});  
> }

but this does not seem to work as the provisioning script stops with a fault at the first declare. Is there a way to prevent a provisioning script to exit in case of a CPE fault and to be able to detect this from inside?  
PS: i’m using genieacs 1.2 beta  
Thank you!

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [April 27, 2020, 5:38pm UTC](https://forum.genieacs.com/t/handling-cpe-faults/743/2 "2020-04-27T17:38:16Z")

</div>

Leave the type off and let GenieACS handle that. It will read the param type from the model for the device and do what is necessary.

---

<div class="post-metadata">

**Author:** ![lavira](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lavira](https://forum.genieacs.com/u/lavira)\
**Post date:** [April 29, 2020, 6:01pm UTC](https://forum.genieacs.com/t/handling-cpe-faults/743/3 "2020-04-29T18:01:00Z")

</div>

Thank you Dan, I knew that but some of the devices rejected the SPV with a code of 9000+ (invalid arguments) but worked if the SPV had the type set as int.  
Luckly, genieacs is very flexible, and I found that from v1.1.2 you can pass in the config BOOLEAN\_LITERAL=false to use 1/0 for boolean values … this fixed the problems I had with this devices.  
But I would like to know if it’s possible to catch a device fault from inside the provision script … we could make an external API call to notify the device provision failed

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [April 29, 2020, 10:36pm UTC](https://forum.genieacs.com/t/handling-cpe-faults/743/4 "2020-04-29T22:36:36Z")

</div>

There is no way to my knowledge to catch a device fault from within a script.
