I am confused about the whole try catch block. I understand if an exception is thrown it execute the catch block, however I have a question regarding using return inside the try block.
try {
//other logic is here
//this is in laravel and sends the user back and should stop operation
if (foo != bar) {
return Redirect::back()->with_message('This auction is closed.', 'error');
}
} catch (Exception $e) {
return $e->getMessage();
}
So my question is: is it okay to end operation inside the try block? Will I ever encounter an error where the return is ignored (or thought of as an exception?) and the code continues? Again, I'm very new to this.