Select to view content in your preferred language

What if Portal could not be connected

799
2
03-17-2014 01:59 AM
R_Spitzer
Esri Contributor
Hi,

I'm dealing with the Portal Item of the JS-API 3.8.
Everything works very well, but I'm trying to build in some error-handling functionality. What if the Portal is not reachable at connection time?
My code looks like this:
portal = new esri.arcgis.Portal(displayOptions.portalUrl);
portal.on('load', loadPortal);


But if the portal is not reachable "loadPortal" never gets called. How can I implement an error message, that the connection to the portal could not be established. I'm missing an "onError" - Event on the portal-Item...
0 Kudos
2 Replies
JeffPace
MVP Alum
I know its not ideal, but I would use

console.dir(portal) before the load event call to sniff it and see if there is an undocumented error method
0 Kudos
R_Spitzer
Esri Contributor
Hi Jeff,

thank you for the hint. But I can't find any undocumented function, which gives a functionality like this.

Has anybody else an idea about this problem?
0 Kudos