[eluser]jonez[/eluser]
[quote author="Andrewkha" date="1390410732"]Hi
Thanks for your response. However the question is which condition should I check in the try/catch statement? When the exception should be thrown?
If I do smth like
try
if(!$this->db->delete($this->table)) {
throw new Exception()}
catch (...)
it doesn't generate any exception. Just get the error as in my initial post...[/quote]
You would write it like this:
Code:
try {
$deleted = true;
$this->db->where( ... );
$this->db->delete( ... );
}
catch ( Exception $e ) {
$deleted = false;
}
if ( $deleted == false ) {
//show page with error msg
}
else {
//show normal page
}
If that doesn't allow you to bypass the exception I'd look into the db debug flag CroNiX mentioned, I've never had to use it so I can't provide any insight on it.