Add default for in Exception class.
authoreileen <emcnaughton@wikimedia.org>
Thu, 13 Dec 2018 00:07:53 +0000 (13:07 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 13 Dec 2018 00:07:53 +0000 (13:07 +1300)
More similar to parent & fixes a notice

api/Exception.php

index 8c6ca5ba73d26c9e04381065d2416509547692f6..dffc00bd65d29747d7affa6c0595d7ba8fb13bf1 100644 (file)
@@ -106,7 +106,7 @@ class CiviCRM_API3_Exception extends Exception {
    * @param Exception|NULL $previous
    *   A previous exception which caused this new exception.
    */
-  public function __construct($message, $error_code, $extraParams = array(), Exception $previous = NULL) {
+  public function __construct($message, $error_code = 0, $extraParams = array(), Exception $previous = NULL) {
     parent::__construct(ts($message));
     $this->extraParams = $extraParams + array('error_code' => $error_code);
   }