code = $params['code']; } if(isset($params['msg'])){ $this->message = $params['msg']; } // 参数errCode 等效于 传参errorCode if(isset($params['errCode'])){ $params['errorCode'] = $params['errCode']; } if(isset($params['errorCode'])) { $this->errorCode = $params['errorCode']; } if ( isset($params['path']) ) { $this->path = empty($params['path'])?[]:$params['path']; } //将此次异常信息入栈 array_unshift($this->path,'Service:'.APP_NAME.' file:'.$this->file.$this->line)//将本次错误调用加入path //json序列化path && $this->path = json_encode($this->path); parent::__construct($this->message, $this->code); } public function getErrcode(){ return $this->errorCode; } public function getPath() { return $this->path; } }