Well the title says it all. I want to get any php error, warning, notice and alert them via JavaScript in my own format. Is that possible? If yes then how? I have tried this but it won't catch warnings or notices i guess.

```
try{
    $result = oci_parse($conn, $query);
    oci_execute($result);
}catch(Exception  $e){
    echo 'Caught exception: ',  $e->getMessage(), "\n";  
    ///////////or anything to alert with JavaScript///////////
}

```