You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using a summoner who DO NOT EXISTS the output is 👍
$summoner = $api->getSummonerByName($summonerName);
Fatal error: Uncaught RiotAPI\Base\Exceptions\ForbiddenException: LeagueAPI: Forbidden. Data not found - summoner not found in /home/xxx.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/dolejska-daniel/riot-api-base/src/Base/BaseAPI.php:1127 Stack trace:
#0 /home/140198.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/dolejska-daniel/riot-api-base/src/Base/BaseAPI.php(1063): RiotAPI\Base\BaseAPI->processCallResult()
#1 /home/xxx.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/guzzlehttp/promises/src/Promise.php(204): RiotAPI\Base\BaseAPI->RiotAPI\Base\{closure}()
#2 /home/xxx.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler()
#3 /home/xxx.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /home/xx.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(158): GuzzleHttp\Promise\TaskQueue in /home/140198.cloudwaysapps.com/fxzmmrqygx/public_html/vendor/dolejska-daniel/riot-api-base/src/Base/BaseAPI.php on line 1127
The answer is correct but it stop working
P.s.
Excellent work!!
The text was updated successfully, but these errors were encountered:
Hello, sorry for the delay! I'm not quite sure what the problem is. If the summoner is not found by the API, the library raises an exception - this stops the program if not caught in try-catch block. Is this what you're looking for?
<?php// ...try {
$summoner = $api->getSummonerByName($summonerName);
} catch (RiotAPI\Base\Exceptions\ForbiddenException$ex) {
// handle summoner not being found
}
using a summoner who DO NOT EXISTS the output is 👍
$summoner = $api->getSummonerByName($summonerName);
The answer is correct but it stop working
P.s.
Excellent work!!
The text was updated successfully, but these errors were encountered: