[ create a new paste ] login | about

Link: http://codepad.org/sEhNYcFU    [ raw code | output | fork ]

PHP, pasted on Jan 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php 
class PDOException extends Exception {
}


class DataBaseException extends Exception {
}

function pdoExceptionHandler($e) {
    if ($e instanceof PDOException) {
        echo 'Erro PDO Capturado!';
    } else {
        throw $e;
    }
}
set_exception_handler("pdoExceptionHandler");

throw new PDOException('erro pdo');


Output:
1
Erro PDO Capturado!


Create a new paste based on this one


Comments: