Rename handle_database_error to handle_error

This commit is contained in:
ruan 2016-02-21 06:47:56 +02:00
parent db4f0c3d80
commit c9bc532c82
5 changed files with 6 additions and 6 deletions

View File

@ -60,7 +60,7 @@ class Check {
} }
*/ */
} catch (PDOException $ex) { } catch (PDOException $ex) {
Settings::handle_database_error($page->settings, $ex); Settings::handle_error($page->settings, $ex);
} }
} }

View File

@ -205,5 +205,5 @@ try {
$page->print_footer(); $page->print_footer();
} catch (PDOException $ex) { } catch (PDOException $ex) {
Settings::handle_database_error($page->settings, $ex); Settings::handle_error($page->settings, $ex);
} }

View File

@ -26,7 +26,7 @@ function __construct($page) {
'kicks.php' => $row['c_kicks'], 'kicks.php' => $row['c_kicks'],
); );
} catch (PDOException $ex) { } catch (PDOException $ex) {
Settings::handle_database_error($page->settings, $ex); Settings::handle_error($page->settings, $ex);
} }
} }
} }

View File

@ -129,7 +129,7 @@ class Page {
return $st; return $st;
} catch (PDOException $ex) { } catch (PDOException $ex) {
Settings::handle_database_error($this->settings, $ex); Settings::handle_error($this->settings, $ex);
} }
} }

View File

@ -113,7 +113,7 @@ final class Settings {
$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
} catch (PDOException $e) { } catch (PDOException $e) {
Settings::handle_database_error($this, $e); Settings::handle_error($this, $e);
} }
if ($driver === 'pgsql') { if ($driver === 'pgsql') {
$this->conn->query("SET NAMES 'UTF8';"); $this->conn->query("SET NAMES 'UTF8';");
@ -126,7 +126,7 @@ final class Settings {
* @param $settings Settings * @param $settings Settings
* @param $e Exception * @param $e Exception
*/ */
static function handle_database_error($settings, $e) { static function handle_error($settings, $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if ($settings->error_pages) { if ($settings->error_pages) {
if (strstr($message, "Access denied for user")) { if (strstr($message, "Access denied for user")) {