Closed rensknoors closed 8 years ago
That is very strange because it seems like it's finding the error properly. NOT_FOUND is 404 error code response from the API. Which is what you would expect from a non-existent summoner. The 500 error is an error from your PHP server, meaning something went wrong.
My guess is you didn't wrap your call in a try catch block? Look at the example https://github.com/kevinohashi/php-riot-api/blob/master/testing.php
It seems you're not catching the exception the API throws when a summoner isn't found. If you catch that, I think your code will work just fine.
You were right, I just made a stupid mistake with the try catch. I forgot the (Exception $e) after catch. Guess I was just tired :(
No problem. Happens to the best of us :)
Thanks again for your work,
I've run into some trouble again. Whenever i try to search the summonerID from a non-existent summoner name, the request reaches a error 500 page.
The problem now is that I can't get rid of this error. I tried error handling already (try catch and a normal if statement) but it doesn't work because nothing is stored inside the variable i want to store the ID in.
This part of code is where it all goes wrong
I got this error when i enabled display errors:
I hope you get more out of it then I did.