From ace09e1280e28e7a8f9a8657b2c6b88bdb6c0389 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 18 Jun 2015 20:24:54 -0700 Subject: [PATCH] api/v3/Cxn - Tweak error --- api/v3/Cxn.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v3/Cxn.php b/api/v3/Cxn.php index 102d6d0bbb..a3d2a10ebd 100644 --- a/api/v3/Cxn.php +++ b/api/v3/Cxn.php @@ -75,9 +75,12 @@ function civicrm_api3_cxn_register($params) { if (!CRM_Cxn_BAO_Cxn::isAppMetaVerified()) { list ($status, $json) = CRM_Utils_HttpClient::singleton()->get($params['app_meta_url']); if (CRM_Utils_HttpClient::STATUS_OK != $status) { - throw new API_Exception("Failed to download appMeta."); + throw new API_Exception("Failed to download appMeta. (Bad HTTP response)"); } $appMeta = json_decode($json, TRUE); + if (empty($appMeta)) { + throw new API_Exception("Failed to download appMeta. (Malformed)"); + } } else { // Note: The metadata includes a cert, but the details aren't signed. -- 2.25.1