Skip to content

Commit f34cfa6

Browse files
committed
CHANGE: remove class and function from error message
1 parent f7a1ab7 commit f34cfa6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/PHPDO.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function connect(string $host, string $database, string $user, string $pa
7474
$this->PDO = new PDO("mysql:host={$host};dbname={$database};port={$port}", $user, $password, $options);
7575
}
7676
catch (PDOException $e) {
77-
die(__CLASS__ . "->" . __FUNCTION__ . "() " . $e->getCode() . ": " . $e->getMessage());
77+
die("error on line " . __LINE__ . ": " . $e->getCode());
7878
}
7979

8080
// set PHPDO instance
@@ -133,7 +133,7 @@ public function query(string $query) {
133133
$queryObj = $this->PDO->query($query);
134134
}
135135
catch (PDOException $e) {
136-
die(__CLASS__ . "->" . __FUNCTION__ . "() " . $e->getCode() . ": " . $e->getMessage());
136+
die("error on line " . __LINE__ . ": " . $e->getCode());
137137
}
138138

139139
$this->addLog($query, gettype($queryObj));
@@ -158,7 +158,7 @@ public function prepare(string $query, array $mapping = []) : PDOStatement {
158158
$execute = $pdoStmnt->execute($mapping);
159159
}
160160
catch (PDOException $e) {
161-
die(__CLASS__ . "->" . __FUNCTION__ . "() " . $e->getCode() . ": " . $e->getMessage());
161+
die("error on line " . __LINE__ . ": " . $e->getCode());
162162
}
163163

164164
$this->addLog($pdoStmnt->queryString, $execute);
@@ -179,7 +179,7 @@ public function execute(string $query) : int {
179179
$exec = $this->PDO->exec($query);
180180
}
181181
catch (PDOException $e) {
182-
die(__CLASS__ . "->" . __FUNCTION__ . "() " . $e->getCode() . ": " . $e->getMessage());
182+
die("error on line " . __LINE__ . ": " . $e->getCode());
183183
}
184184

185185
$this->addLog($query, $exec);
@@ -200,7 +200,7 @@ public function isTable(string $table) : bool {
200200
$pdoStmnt = $this->query(sprintf("DESCRIBE `%s`", $table));
201201
}
202202
catch (PDOException $e) {
203-
die(__CLASS__ . "->" . __FUNCTION__ . "() " . $e->getCode() . ": " . $e->getMessage());
203+
die("error on line " . __LINE__ . ": " . $e->getCode());
204204
}
205205

206206
if ($pdoStmnt instanceof PDOStatement) {

0 commit comments

Comments
 (0)