From 57e2980f567e62fa74769201d1cb6c209282149e Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Fri, 21 Nov 2014 11:39:06 +0100 Subject: [PATCH] Nicer error message --- zones.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zones.php b/zones.php index f7fe0b2..f8ed210 100644 --- a/zones.php +++ b/zones.php @@ -62,6 +62,9 @@ function api_request($path, $opts = null, $type = null) { if (isset($json['error'])) { jtable_respond(null, 'error', "API Error $code: ".$json['error']); } elseif ($code < 200 || $code >= 300) { + if ($code == 401) { + $code = "Authentication failed. Have you configured your authmethod correct?"; + } jtable_respond(null, 'error', "API Error: $code"); } return $json;