99
1010use Shopify \Shopify ;
1111use Shopify \Util ;
12- use Shopify \Exception ;
1312
1413class Client
1514{
@@ -104,7 +103,7 @@ public function request(Request $request)//$method, $url, $params = array(), $js
104103 }
105104 }
106105 } else {
107- throw new Exception \ApiException ("Unrecognized method {$ method }" );
106+ throw new \ Shopify \ Exception \ApiException ("Unrecognized method {$ method }" );
108107 }
109108 $ opts [CURLOPT_URL ] = $ url ;
110109 $ opts [CURLOPT_RETURNTRANSFER ] = TRUE ;
@@ -138,16 +137,16 @@ public function request(Request $request)//$method, $url, $params = array(), $js
138137 $ errors = $ jsonBody ->errors ;
139138 if (is_string ($ errors ))
140139 {
141- throw new Exception \ApiException ($ errors );
140+ throw new \ Shopify \ Exception \ApiException ($ errors );
142141 } else {
143142 $ field = key ((array ) $ errors );
144143 $ error = $ errors ->{$ field }[0 ];
145- throw new Exception \ApiException (ucfirst ($ field ).' ' .$ error );
144+ throw new \ Shopify \ Exception \ApiException (ucfirst ($ field ).' ' .$ error );
146145 }
147146 }
148147 unset($ jsonBody );
149148
150-
149+
151150 $ this ->handleHttpCode ($ response ->getHttpCode ());
152151 return $ response ;
153152 }
@@ -183,7 +182,7 @@ private function handleHttpCode($code)
183182 break ;
184183 default : $ msg = "An unknown error code [ {$ code }] was returned " ;
185184 }
186- throw new Exception \ApiException ($ msg );
185+ throw new \ Shopify \ Exception \ApiException ($ msg );
187186 }
188187 }
189188
@@ -207,7 +206,7 @@ private function handleCurlError($url, $errno, $message)
207206 $ msg = "nUnexpected error communicating with Shopify " ;
208207 }
209208 $ msg .= "\n\n(Network error [errno $ errno]: $ message) " ;
210- throw new Exception \CurlException ($ msg );
209+ throw new \ Shopify \ Exception \CurlException ($ msg );
211210 }
212211
213212 /**
0 commit comments