Add a return false if category doesn't exist
If DEBUG_MODE is off, exception is not throw. False is returned instead.
This commit is contained in:
parent
83914e7601
commit
23019a31c1
1 changed files with 8 additions and 4 deletions
|
@ -17,7 +17,11 @@ class Category {
|
|||
} else {
|
||||
$errorMessage = 'Category not found in database by key ['.$key.']';
|
||||
Log::set(__METHOD__.LOG_SEP.$errorMessage);
|
||||
if (DEBUG_MODE === true) {
|
||||
throw new Exception($errorMessage);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue