File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,7 +245,11 @@ public function selectSuggestion(int $index): void
245245 if (isset ($ suggestion ['lat ' ]) && isset ($ suggestion ['lon ' ])) {
246246 $ position = [$ suggestion ['lat ' ], $ suggestion ['lon ' ]];
247247 } else {
248- $ position = resolve (AutocompleteService::class)->getSearchPosition ($ suggestion ['placeId ' ]);
248+ try {
249+ $ position = resolve (AutocompleteService::class)->getSearchPosition ($ suggestion ['placeId ' ]);
250+ } catch (Exception $ e ) {
251+ flash ()->error ($ e ->getMessage ())->now ();
252+ }
249253 }
250254 $ this ->searchQuery = $ suggestion ['title ' ];
251255 if (is_array ($ position )) {
@@ -274,7 +278,11 @@ public function updatedSearchQuery(): void
274278 $ this ->dispatch ('resetMap ' );
275279 } else {
276280 $ this ->isSearching = true ;
277- $ this ->suggestions = resolve (AutocompleteService::class)->search ($ this ->searchQuery );
281+ try {
282+ $ this ->suggestions = resolve (AutocompleteService::class)->search ($ this ->searchQuery );
283+ } catch (Exception $ e ) {
284+ flash ()->error ($ e ->getMessage ())->now ();
285+ }
278286 }
279287 }
280288}
You can’t perform that action at this time.
0 commit comments