Empty Web Service Exception

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

Post Reply
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Empty Web Service Exception

Post by steeffeen »

Hey

Every now and then the Web Service SDK throws an empty Exception (code 0 and no message).
They appear on various requests like Player's Maniastars or Serverlists.
I sort of think it's caused by connection errors.

An example vardump:

Code: Select all

object(Maniaplanet\WebServices\Exception)#10 (9) {
 ["HTTPStatusCode":protected]=>
 int(0)
 ["HTTPStatusMessage":protected]=>
 NULL
 ["message":protected]=>
 string(0) ""
 ["string":"Exception":private]=>
 string(0) ""
 ["code":protected]=>
 int(0)
 ["file":protected]=>
 string(85) "/.../lib/maniaplanet-ws-sdk/libraries/Maniaplanet/WebServices/HTTPClient.php"
 ["line":protected]=>
 int(338)
 ["trace":"Exception":private]=>
 array(2) {
   [0]=>
   array(6) {
     ["file"]=>
     string(82) "/.../lib/maniaplanet-ws-sdk/libraries/Maniaplanet/WebServices/Players.php"
     ["line"]=>
     int(42)
     ["function"]=>
     string(7) "execute"
     ["class"]=>
     string(34) "Maniaplanet\WebServices\HTTPClient"
     ["type"]=>
     string(2) "->"
     ["args"]=>
     array(3) {
       [0]=>
       string(3) "GET"
       [1]=>
       string(23) "/players/%s/maniastars/"
       [2]=>
       array(1) {
         [0]=>
         string(5) "sylv1"
       }
     }
   }
   [1]=>
   array(6) {
     ["file"]=>
     string(37) "/.../cron/php/maniastars.php"
     ["line"]=>
     int(93)
     ["function"]=>
     string(13) "getManiastars"
     ["class"]=>
     string(31) "Maniaplanet\WebServices\Players"
     ["type"]=>
     string(2) "->"
     ["args"]=>
     array(1) {
       [0]=>
       string(5) "sylv1"
     }
   }
 }
 ["previous":"Exception":private]=>
 NULL
}
array(2) {
 [0]=>
 array(6) {
   ["file"]=>
   string(82) "/.../lib/maniaplanet-ws-sdk/libraries/Maniaplanet/WebServices/Players.php"
   ["line"]=>
   int(42)
   ["function"]=>
   string(7) "execute"
   ["class"]=>
   string(34) "Maniaplanet\WebServices\HTTPClient"
   ["type"]=>
   string(2) "->"
   ["args"]=>
   array(3) {
     [0]=>
     string(3) "GET"
     [1]=>
     string(23) "/players/%s/maniastars/"
     [2]=>
     array(1) {
       [0]=>
       string(5) "sylv1"
     }
   }
 }
 [1]=>
 array(6) {
   ["file"]=>
   string(37) "/home/steeffe/cron/php/maniastars.php"
   ["line"]=>
   int(93)
   ["function"]=>
   string(13) "getManiastars"
   ["class"]=>
   string(31) "Maniaplanet\WebServices\Players"
   ["type"]=>
   string(2) "->"
   ["args"]=>
   array(1) {
     [0]=>
     string(5) "sylv1"
   }
 }
}
(my Players.php has additional lines for maniastars fetching)

Code: Select all

function getManiastars($login) {
	if (!$login) {
		throw new Exception('Invalid login');
	}
	return $this->execute('GET', '/players/%s/maniastars/', array($login));
}
Am I the only one this happens to?
What could be causing this?

Regards,
Steff
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Post Reply

    Return to “Maniaplanet Web Services”

    Who is online

    Users browsing this forum: No registered users and 1 guest