Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/365'
Browse files Browse the repository at this point in the history
Close #365
Fixes #364
  • Loading branch information
weierophinney committed Oct 11, 2016
2 parents e251912 + ba85aa6 commit 3d8d647
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#365](https://github.com/zfcampus/zf-apigility-admin/pull/365) updates the
logic in the `DbAutodiscoveryModel` to catch and report exceptions due to
metadata discovery issues (typically invalid character sets) that were
previously returning an empty list, providing better diagnostic details to
end-users.

## 1.5.7 - 2016-08-14

Expand Down
6 changes: 5 additions & 1 deletion src/Model/DbAutodiscoveryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Zend\Db\Adapter\Adapter;
use Zend\Db\Metadata\Metadata;
use Zend\Db\Exception\InvalidArgumentException;

/**
* Class DbAutodiscoveryModel
Expand All @@ -34,7 +35,10 @@ public function fetchColumns($module, $version, $adapter_name)

try {
$metadata = new Metadata($adapter);
} catch (\Exception $e) {
} catch (InvalidArgumentException $e) {
if (strpos($e->getMessage(), 'Unknown adapter platform') === false) {
throw $e;
}
return [];
}

Expand Down

0 comments on commit 3d8d647

Please # to comment.