php, can exceptions be thrown 2 levels up?

前端 未结 3 1234
滥情空心
滥情空心 2021-01-18 07:19

I know this is a weird on, but in my code, i have development mode errors, and production mode errors. This is the function i have:

private function error($m         


        
3条回答
  •  迷失自我
    2021-01-18 07:49

    An exception will automatically travel up the call chain until it reaches the highest level. If it's not caught there, program execution terminates due to an uncaught exception. The whole point of exceptions is to be able to have errors bubble up. You don't need to throw harder or do anything special to "throw it up 2 levels", that's what it does by definition.

提交回复
热议问题