PHP Fatal error when a DB error throw a RuntimeException exception

It may happen that an error is resulting of a DB Error.
In this case the $error can be a "RuntimeException" object that does not contain the "get" function.

This fix allow verifying that the $error has a "get" method and avoid a PHP Fatal error that forbid to report the real DB error.