<?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: ErrorMode 0 blocks script errors from Connectors? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ErrorMode-0-blocks-script-errors-from-Connectors/m-p/1191812#M627966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed, ScriptError and ScriptErrorDetails won't receive any information when a Connector encounters an error. But to my suprise, both ScriptErrorCount and ScriptErrorList will be updated with (partially) relevant information. ScriptErrorCount will be incremented and ScriptErrorList will receive a new text string "General Custom Database Error".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well it's better than nothing. More so because both variables can be reset before custom error handling is going to take over. That way, there will be only one value to check, and one message to display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code like this can be used to handle Connector errors in a customised way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 0; // We take over from here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET ScriptErrorCount = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET ScriptErrorList = '';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CUSTOM CONNECT TO ...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SQL SELECT ...; // Perform some DB operation through this connection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF ScriptErrorCount &amp;gt; 0 THEN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; TRACE &amp;gt;&amp;gt;&amp;gt; An error occured while reading from DB. Reason = $(ScriptErrorList);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;END IF&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Retry or do whatever is necessary&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 14:40:00 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2016-10-27T14:40:00Z</dc:date>
    <item>
      <title>ErrorMode 0 blocks script errors from Connectors?</title>
      <link>https://community.qlik.com/t5/QlikView/ErrorMode-0-blocks-script-errors-from-Connectors/m-p/1191811#M627965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently, the tried and tested ErrorMode technique for intercepting error handling in a QlikView load script doesn't work when using a Connector to stream data from an external source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When dealing with ODBC/OLEDB connections or loading data from a QVD, this usually performs very well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Test: LOAD Dummy FROM abc.qvd (qvd); // Doesn't exist&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vError = ScriptError; // vError now contains the error details to be acted upon&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 1; // Restore default handling&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, when using a Connector no more error details are passed to the script when ErrorMode equals 0. It seems as if everything is wiped out, and only a text message is printed to the log/progress window. Setting ErrorMode back to 1, the script interupts at the first Connector failure so some communication must be happening...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My case centers around the SAP Connector, because I would like to make a table extraction that occasionally fails restartable. No luck so far. The script engine isn't even aware that something went wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has an idea how to handle this without QV taking over Does anyone have the same experience when using another Connector?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 10:43:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ErrorMode-0-blocks-script-errors-from-Connectors/m-p/1191811#M627965</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-10-25T10:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: ErrorMode 0 blocks script errors from Connectors?</title>
      <link>https://community.qlik.com/t5/QlikView/ErrorMode-0-blocks-script-errors-from-Connectors/m-p/1191812#M627966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed, ScriptError and ScriptErrorDetails won't receive any information when a Connector encounters an error. But to my suprise, both ScriptErrorCount and ScriptErrorList will be updated with (partially) relevant information. ScriptErrorCount will be incremented and ScriptErrorList will receive a new text string "General Custom Database Error".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well it's better than nothing. More so because both variables can be reset before custom error handling is going to take over. That way, there will be only one value to check, and one message to display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code like this can be used to handle Connector errors in a customised way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 0; // We take over from here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET ScriptErrorCount = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET ScriptErrorList = '';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CUSTOM CONNECT TO ...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SQL SELECT ...; // Perform some DB operation through this connection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF ScriptErrorCount &amp;gt; 0 THEN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; TRACE &amp;gt;&amp;gt;&amp;gt; An error occured while reading from DB. Reason = $(ScriptErrorList);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;END IF&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Retry or do whatever is necessary&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET ErrorMode = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 14:40:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ErrorMode-0-blocks-script-errors-from-Connectors/m-p/1191812#M627966</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-10-27T14:40:00Z</dc:date>
    </item>
  </channel>
</rss>

