+ /**
+ * Get extra parameters.
+ *
+ * @return array
+ * @deprecated Remove in v6.0. Compatibility with older API_Exception/CiviCRM_API3_Exception contracts.
+ */
+ public function getExtraParams() {
+ return $this->errorData;
+ }
+
+ /**
+ * Get error codes.
+ *
+ * DIVERGENCE: API_Exception defined a discoverable list of error-codes. CRM_Core_Exception and CiviCRM_API3_Exception did not.
+ *
+ * @return array
+ */
+ public function getErrorCodes() {
+ return [
+ 2000 => '$params was not an array',
+ 2001 => 'Invalid Value for Date field',
+ 2100 => 'String value is longer than permitted length',
+ self::UNAUTHORIZED => 'Unauthorized',
+ self::NOT_IMPLEMENTED => 'Entity or method is not implemented',
+ ];
+ }
+