Hello,
I’m facing an issue with the declare() function in my provisioning script.
Here is a simplified example:
try {let RXPower = declare(“InternetGatewayDevice.WANDevice.1.X_GponInterafceConfig.CATVRXPower”,{ value: Date.now() }).value[0];} catch (e) {
}
When the device responds with an error (e.g., faultCode: 9002, faultString: "Internal error"), the script execution stops immediately. The exception is not caught by the try-catch block, and the whole task fails.
My problem is that I cannot reach the next line after declare() when this happens, so I cannot handle the error gracefully inside the script.
-
Is this the expected behavior of
declare()? -
Is there any way to check the existence/availability of a parameter (or catch such errors) before calling
declare()with a value? -
How should we safely handle parameters that may not exist or may throw
Internal errorwithout killing the whole task?
Any guidance or best practices would be greatly appreciated.
Thanks in advance!