CRM-21052 - Activity.create API - Abide by setting `civicaseActivityRevisions`
[civicrm-core.git] / api / v3 / Dashboard.php
index 904fc837cfe9e3c1883f69923e1ce49947fec301..cf5aae7b2f27fca5444dbd97288c796cc0029504 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -85,14 +85,14 @@ function civicrm_api3_dashboard_get($params) {
  *
  * @param array $params
  *   Array holding 'id' of dashlet to be deleted.
- *
  * @return array
+ * @throws API_Exception
  */
 function civicrm_api3_dashboard_delete($params) {
   if (CRM_Core_BAO_Dashboard::deleteDashlet($params['id'])) {
     return civicrm_api3_create_success(1, $params, 'Dashboard', 'delete');
   }
   else {
-    return civicrm_api3_create_error('Could not delete dashlet');
+    throw new API_Exception('Could not delete dashlet');
   }
 }