Handling CPE faults

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!

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.

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

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