22
33namespace TraderInteractive \NetAcuity \Databases ;
44
5+ use TraderInteractive \NetAcuity \Exceptions \NetacuityException ;
56use TraderInteractive \Util \Arrays ;
6- use Exception ;
77use GuzzleHttp \ClientInterface ;
88use GuzzleHttp \Exception \ClientException ;
99use GuzzleHttp \Psr7 \Request ;
@@ -66,7 +66,7 @@ public function __construct(
6666 *
6767 * @return array The formatted data set.
6868 *
69- * @throws Exception On failure to send a Guzzle request.
69+ * @throws NetacuityException On failure to send a Guzzle request.
7070 */
7171 public function fetch (string $ ip )
7272 {
@@ -87,7 +87,7 @@ public function fetch(string $ip)
8787 /**
8888 * @param ClientException $e The thrown exception for handling.
8989 *
90- * @throws Exception A formatted exception masking the API User Token in the event that it becomes invalid.
90+ * @throws NetacuityException A formatted exception masking the API User Token in the event that it becomes invalid.
9191 *
9292 * @return void
9393 */
@@ -97,13 +97,13 @@ protected function handleGuzzleException(ClientException $e)
9797 $ code = $ response ->getStatusCode ();
9898
9999 if ($ code === 403 ) {
100- throw new Exception ('NetAcuity API rejected the provided api user token. ' , $ code );
100+ throw new NetacuityException ('NetAcuity API rejected the provided api user token. ' , $ code );
101101 }
102102
103103 $ error = json_decode ($ response ->getBody ()->getContents (), true );
104104 $ reason = Arrays::getNested ($ error , 'error.message ' );
105105
106- throw new Exception ("NetAcuity API rejected the request, Reason: {$ reason }" , $ code );
106+ throw new NetacuityException ("NetAcuity API rejected the request, Reason: {$ reason }" , $ code );
107107 }
108108
109109 /**
0 commit comments