Fatal Errors when DataBase command fails |
(10-18-2019, 01:41 PM)kilishan Wrote: Instead of checking for the number of affected rows, catch the Exception that's being thrown. You can handle the same situation you're trying now within the catch block. I was already using an Try Catch when I call this function (it is inside a Modal). But I tried to make the Try Catch just around the Insert method or all the my $db function but it didn't prevent the request from being shut down and return status 500 to my browser. I tried catch(Exception $ex){... and catch(FormatException $ex){ Here is what is happening to the request: (repair the echo "Hello World 1!!\n" and echo "Hello world 2!!\n") http://prntscr.com/pl9oub And here is the code I'm running: Code: public function addAudio($name, $path){ |
Messages In This Thread |
Fatal Errors when DataBase command fails - by GuilhermeBiz - 10-18-2019, 07:34 AM
RE: Fatal Errors when DataBase command fails - by titounnes - 10-18-2019, 10:14 AM
RE: Fatal Errors when DataBase command fails - by GuilhermeBiz - 10-18-2019, 10:24 AM
RE: Fatal Errors when DataBase command fails - by kilishan - 10-18-2019, 01:41 PM
RE: Fatal Errors when DataBase command fails - by GuilhermeBiz - 10-18-2019, 02:04 PM
|