catch exception in model not database.php