RAF.setAdUrl with package file

Hi,

Trying to set RAF.setAdUrl() with a local file (VMAP) but it’s crashing inside RAF.
i.e.

#5  Function roku_ads_parser_parse(xmldata_ As String, adserver_ As String) As Object
   file/line: roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)

This is what I’m doing:
Note that the test of ReadAsciiFile() succeeds and outputs the file correctly.

file = "pkg:/config/ads.xml"

' test: succeeds
adXML = ReadAsciiFile(file)
? adXML

' crashes RAF
adInterface.setAdUrl(file)

The captured VMAP had been read processed by RAF previously, when retrieved via HTTP.
Any ideas?

Tell me the firmware version, model #, RAF version.
Also give me a detailed error message, including the full stack (not only #5) and the exact error message (in other words copy&paste more context from the console). Showing the VMAP file may help too.

Sorry, this issue was “user error” on my part. The VMAP xml I used didn’t parse.

However as a possible improvement the error-handling in the RAF VMAP parser could be improved to not crash :slightly_smiling_face:

These are the logs:

Roku_Ads Framework version 2.0108

Roku_Ads_util_getStringFromUrl: requesting URL: pkg:/config/ads.xml

Suspending threads...
Thread selected:  1*   ...ib:/Roku_Ads_VAST_Parser.brs(190)    ??

Current Function:
182:  ??
183:  ??
184:  ??
185:  ??
186:  ??
187:  ??
188:  ??
189:  ??
190:* ??
191:  ??
Use of uninitialized variable. (runtime error &he9) in roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)
190: ??
Backtrace:
#5  Function roku_ads_parser_parse(xmldata_ As String, adserver_ As String) As Object
   file/line: roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)
#4  Function roku_ads_getads() As Dynamic
   file/line: roku_ads_lib:/Roku_Ads.brs(3966)

Local Variables:
No variable info.
Threads:
ID    Location                                Source Code

 1*   ...ib:/Roku_Ads_VAST_Parser.brs(190)    ??
  *selected

“acreskey” wrote:
However as a possible improvement the error-handling in the RAF VMAP parser could be improved to not crash :slightly_smiling_face:
Absolutely. I just saw where the issue is and we’ll plug it - thank you for the report and the details!

And done - RAF 2.2 is out.

“RokuNB” wrote:
And done - RAF 2.2 is out.
Nice!