Closed
Description
When Piwik cannot connect to the database, the API should return a valid response.
Reproduce:
- Edit config.ini.php and set a wrong username for the database eg.
xyytueyeat
- Open
index.php?module=API&method=API.getPiwikVersion&format=xml
- Got: HTML error output
- Expected:
- HTTP error code 500,
- and the API call returns a valid eg. XML response that returns the API error reponse eg.
<?xml version="1.0" encoding="utf-8" ?>
<result>
<error message="Cannot connect to the database: SQLSTATE[28000] [1045] Access denied for user 'xyytueyeat'@'localhost' (using password: YES)" />
</result>
Steps:
- Add test case
- Fix issue