summaryrefslogtreecommitdiffstats
path: root/lib/SparkPost
diff options
context:
space:
mode:
authorJames Fellows <james.fellows@finanscapes.com>2016-04-19 19:35:01 +0100
committerRichard Leland <rich@richleland.com>2016-04-19 14:35:01 -0400
commit34a4ae387ad4f74f69ba00296430918824727422 (patch)
tree8e3840de575fd157a826be46911a27500890c379 /lib/SparkPost
parentacb590ef2cdda14900016364f2903200846fe8db (diff)
downloadphp-sparkpost-34a4ae387ad4f74f69ba00296430918824727422.zip
php-sparkpost-34a4ae387ad4f74f69ba00296430918824727422.tar.gz
php-sparkpost-34a4ae387ad4f74f69ba00296430918824727422.tar.bz2
Improve Exception message on 403 response (#71)
Fixes #70.
Diffstat (limited to 'lib/SparkPost')
-rw-r--r--lib/SparkPost/APIResource.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/SparkPost/APIResource.php b/lib/SparkPost/APIResource.php
index 20e7b19..3d0f8c1 100644
--- a/lib/SparkPost/APIResource.php
+++ b/lib/SparkPost/APIResource.php
@@ -193,6 +193,9 @@ class APIResource {
if ($statusCode < 400) {
return json_decode($response->getBody()->getContents(), true);
}
+ elseif ($statusCode === 403) {
+ throw new APIResponseException('Request forbidden. Does this API Key have the correct SparkPost permissions?');
+ }
elseif ($statusCode === 404) {
throw new APIResponseException('The specified resource does not exist', 404);
}