File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,11 @@ public function build($class = Address::class)
100100 throw new \LogicException ('First parameter to LocationBuilder::build must be a class name extending Geocoder\Model\Address ' );
101101 }
102102
103+ $ country = null ;
104+ if (!empty ($ this ->country ) || !empty ($ this ->country )) {
105+ $ country = new Country ($ this ->country , $ this ->countryCode );
106+ }
107+
103108 return new $ class (
104109 $ this ->providedBy ,
105110 new AdminLevelCollection ($ this ->adminLevels ),
@@ -110,7 +115,7 @@ public function build($class = Address::class)
110115 $ this ->postalCode ,
111116 $ this ->locality ,
112117 $ this ->subLocality ,
113- new Country ( $ this -> country , $ this -> countryCode ) ,
118+ $ country ,
114119 $ this ->timezone
115120 );
116121 }
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ protected function getUrlContents($url)
5959 $ response = $ this ->getHttpClient ()->sendRequest ($ request );
6060
6161 $ statusCode = $ response ->getStatusCode ();
62- if (401 === $ statusCode ) {
62+ if (401 === $ statusCode || 403 === $ statusCode ) {
6363 throw new InvalidCredentials ();
6464 } elseif (429 === $ statusCode ) {
6565 throw new QuotaExceeded ();
You can’t perform that action at this time.
0 commit comments