Could you help me? I extract data from an XML file and sometimes the code stops with a fatal error. Sometimes good, sometimes not. How should I modify the attached code snippet so that it doesn’t get 0 and run on Fatal Error?
I get this error:
Warning: Attempt to read property “any” on null in /…/VisionSoap.php on line 169
Fatal error: Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /…/Soap.php:38
Stack trace:
#0 /…/Soap.php(38): DOMDocument->loadXML(”)
#1 /…/VisionSoap.php(169): soapSoap->save(NULL, ‘/…..’)
#2 /…/Downloader.php(55): soapVisionSoap->getMethodArValtozasAuth()
#3 /…/Downloader.php(29): downloaderDownloader->downloadWithSoap(true)
#4 /…/WholeSaleDownloader.php(44): downloaderDownloader->run(true)
#5 /…/App.php(64): downloaderWholeSaleDownloader->run(true)
#6 /…/update.php(22): appApp->update()
#7 {main}
thrown in /…Soap.php on line 38
I am attaching the mentioned part of the code as an image.
What should I change so that it doesn’t run into an error?
It gets the data from an XML that is updated on a daily basis, which probably contains some false data, which causes my code to hang.