mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-09 16:53:11 +08:00
Given more semantic cases in which a visit cannot be located
This commit is contained in:
@@ -30,12 +30,18 @@ class VisitService implements VisitServiceInterface
|
||||
|
||||
foreach ($results as $visit) {
|
||||
$count++;
|
||||
|
||||
try {
|
||||
/** @var Location $location */
|
||||
$location = $geolocateVisit($visit);
|
||||
} catch (IpCannotBeLocatedException $e) {
|
||||
// Skip if the visit's IP could not be located
|
||||
continue;
|
||||
if (!$e->isNonLocatableAddress()) {
|
||||
// Skip if the visit's IP could not be located because of an error
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the IP address is non-locatable, locate it as empty to prevent next processes to pick it again
|
||||
$location = Location::emptyInstance();
|
||||
}
|
||||
|
||||
$location = new VisitLocation($location);
|
||||
|
||||
Reference in New Issue
Block a user