전체 try catch 블록에 대해 혼란스러워합니다. catch 블록을 실행하는 예외가 throw됩니다 이해하지만 try 블록 안에 return 사용에 관한 질문이 있습니다.try catch 블록 이해
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();
}
제 질문은 try 블록 내부에서 작업을 끝내시겠습니까? 반환 값이 무시되거나 예외로 간주되는 코드에서 오류가 발생합니까? 다시 말하지만, 저는 이것에 대해 아주 새로운 것입니다.