Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The following line is really awful, but needs to be one big line so the textarea formatting looks right.
- <textarea style='resize: none; width: 80%; height: 6em; background-color: #888;' readonly>" . $_SERVER["REQUEST_URI"] . " via " . $_SERVER["REQUEST_METHOD"] . " @ " . time() . " -- " . get_class($e) . ": " . (($e->getMessage() === "") ? "No message provided" : $e->getMessage()) . "\n\nSQLSTATE: " . ((isset($errInf[0])) ? $errInf[0] : "Not provided") . "\nDriver Error Code: " . ((isset($errInf[1])) ? $errInf[1] : "Not provided") . "\nDriver Error Message: " . ((isset($errInf[2])) ? $errInf[2] : "Not provided") . "</textarea>";
- An example output would be:
- /login.php?login via POST @ 1496336860 -- PDOException: Inco
- SQLSTATE: 00000
- Driver Error Code: Not provided
- Driver Error Message: Not provided
- It consists of the page ($_SERVER["REQUEST_URI"]) and the method (normally GET or POST, $_SERVER["REQUEST_METHOD"]). It then provides the time, in the form of a Unix timestamp (time()), and then the type of exception thrown, got by get_class($exception), and then the message that the exception contains ($exception->getMessage()).
- Then, if get_class($exception) returned "PDOException", something went wrong with the database. Therefore, it shows some database error information obtained using the errorInfo() method on the static PDO $db object. More info on what errorInfo() returns can be found on the official PHP documentation: http://php.net/manual/en/pdo.errorinfo.php.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement