VisualAppeal / Matomo-PHP-API

PHP wrapper for the Matomo API.
MIT License
95 stars 33 forks source link

Old error replaces new error #17

Closed AlexGanzer closed 9 years ago

AlexGanzer commented 9 years ago

Hi @thelfensdrfer.

There's a bug with errors storing.

If method for example $piwik->addSite(); throw error I can see it with $piwik->getErrors(); // for example - 'You can't access this resource as it requires a 'superuser' access. ...".

But when i use another method (after first with the same instance) for example $piwik->setUserAccess(); and it throw error. In $piwik->getErrors(); i see old error, not a new error (for example "User 'user' doesn't exist.(....)")

It is in this method: private function _addError($msg = '') { $this->_errors = $this->_errors + array($msg); } Thank you.