<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to catch invalid token errors while map is running in browser? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-catch-invalid-token-errors-while-map-is/m-p/1062998#M73326</link>
    <description>&lt;P&gt;We are experiencing the same issue. If we keep map open and with no interaction for some hour, we get same errors and page (map) needs to be refreshed. Do we have a solution for this? Can we catch somewhere this error?&lt;/P&gt;&lt;P&gt;view.when(() =&amp;gt; {}, (err) =&amp;gt; { // handle err });&lt;/P&gt;&lt;P&gt;does not catch anything. Do we have an update on this?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 17:54:46 GMT</pubDate>
    <dc:creator>KosmasKaradimitriou</dc:creator>
    <dc:date>2021-05-28T17:54:46Z</dc:date>
    <item>
      <title>How to catch invalid token errors while map is running in browser?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-catch-invalid-token-errors-while-map-is/m-p/242501#M22461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I catch errors while the map is running in a browser?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;require&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;"esri/WebMap"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;"esri/views/MapView"&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WebMap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;

webmap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;WebMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 portalItem&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"000000000000000000000000000000"&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

view &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapView&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 container&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"viewDiv"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; webmap
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything works fine, but if I don't renew the token in time, or something happens to&amp;nbsp;invalidate the token before it is time to be regenerated, I would get an error like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #222222; background-color: #fff0f0; margin-left: 4px;"&gt;&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;dojo-lite.js:261&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: var(--error-text-color)  !important; background-color: #fff0f0;"&gt;[esri.views.2d.layers.features.controllers.OnDemandController]&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="" style="color: var(--error-text-color)  !important; font-size: 12px !important;"&gt;&lt;DIV class=""&gt;&lt;OL class="" style="color: #212121 !important; font-size: 12px !important;"&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;f&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;SPAN class="" style="color: #565656;"&gt;name&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"featurelayer-controller:tile-error"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #565656;"&gt;message&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"Encountered an error when handling tile response"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #565656;"&gt;details&lt;/SPAN&gt;: &lt;SPAN class=""&gt;{…}&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: white; background-color: #b3cbf7; font-size: 9px; margin: 0px 6px;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;OL class="" style="padding-left: 12px;"&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;details&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;SPAN class="" style="color: #565656;"&gt;name&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"request:server"&lt;/SPAN&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #565656;"&gt;message&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"Invalid token."&lt;/SPAN&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #565656;"&gt;details&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{…}&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;message&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;Encountered an error when handling tile response&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;name&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;featurelayer-controller:tile-error&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I catch that with JavaScript?&amp;nbsp; If I can catch it, I can generate a new token and handle it properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:08:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-catch-invalid-token-errors-while-map-is/m-p/242501#M22461</guid>
      <dc:creator>JoshFields</dc:creator>
      <dc:date>2021-12-11T12:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch invalid token errors while map is running in browser?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-catch-invalid-token-errors-while-map-is/m-p/1062998#M73326</link>
      <description>&lt;P&gt;We are experiencing the same issue. If we keep map open and with no interaction for some hour, we get same errors and page (map) needs to be refreshed. Do we have a solution for this? Can we catch somewhere this error?&lt;/P&gt;&lt;P&gt;view.when(() =&amp;gt; {}, (err) =&amp;gt; { // handle err });&lt;/P&gt;&lt;P&gt;does not catch anything. Do we have an update on this?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 17:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-catch-invalid-token-errors-while-map-is/m-p/1062998#M73326</guid>
      <dc:creator>KosmasKaradimitriou</dc:creator>
      <dc:date>2021-05-28T17:54:46Z</dc:date>
    </item>
  </channel>
</rss>

