You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Homey.createDevice() fails (for instance, when trying to add a device with an id that already exists), an error is shown on screen but the call to the method returns without any clue that it failed (no exception thrown, no undefined returned, no error passed when using callbacks).
The text was updated successfully, but these errors were encountered:
In a custom Pair View I have the following script:
<scripttype="text/javascript">
(function () {const$create=document.getElementById("receiver-add-create");letcreatingDevice=false;$create.addEventListener("click",(e)=>{if(creatingDevice)return;creatingDevice=true;
...
Homey.createDevice(device).then(function(){returnHomey.done();}).catch(function(err){creatingDevice=false;returnHomey.Alert("There is already a device with that House Code and Unit Code combination.");});});})();</script>
EXPECTED: Display an alert if any error happens and if Home.createDevice() is successful paring window will be closed.
ACTUAL WEB APP (Chrome and Edge): Regardless of outcome from Homey.createDevice then() is called, catch() is never called on errors, and if an error occurs Homey will display an error toast I cannot get rid of.
ACTUAL IPHONE APP: When not failing, the then() call is made, but catch() is not called when it fails.
So it seems like in Edge or Chome in the Web App, catch() is never called, then() is always called.
In the IPhone App, catch() is never called, then() is only called on success.
If
Homey.createDevice()
fails (for instance, when trying to add a device with an id that already exists), an error is shown on screen but the call to the method returns without any clue that it failed (no exception thrown, noundefined
returned, noerror
passed when using callbacks).The text was updated successfully, but these errors were encountered: