Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equivalent to NoResult Exception when updating from older versions #1182

Open
VikitorGalevez opened this issue Apr 25, 2023 · 2 comments
Open
Labels

Comments

@VikitorGalevez
Copy link

Hi, im updating my project and i came across this problem. I have some uses for Geocoder\Exception\NoResult, but those no longer exist.
Are there any equivalents? Or should i use the generic exception for this cases?

@jbelien
Copy link
Member

jbelien commented Apr 26, 2023

Hello @VikitorGalevez,

I must admit I don't remember that NoResult exception ; it was probably from a version before I joined the project.

But I think you could migrate that exception catch to the isEmpty() function in AddressCollection class (see AddressCollection.php).

@VikitorGalevez
Copy link
Author

The thing is we have different exceptions thrown if some conditions are met, for example in this case:
if(empty($content))
{
throw new NoResult(sprintf('Could not execute query "%s".', $query));
}

I was just thinking of using the normal exception. How would you use the addressCollection in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants