镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Equivalent to NoResult Exception when updating from older versions #1182

Open

Description

@VikitorGalevez

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?

Activity

  1. jbelien commented on Apr 26, 2023

    @jbelien
    Member

    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).

  2. VikitorGalevez commented on Apr 26, 2023

    @VikitorGalevez
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions