Laravel 4 Exception: NotFoundHttpException

后端 未结 6 839
时光说笑
时光说笑 2020-12-30 07:14

My Laravel 4 application\'s logs sometimes show a NotFoundHttpException:

exception \'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpExce         


        
6条回答
  •  一生所求
    2020-12-30 07:32

    It's really hard to say for sure what is causing this without knowing your code. Looking at the stack trace of the error, it's clear that the Router is dispatching it and I guess it has nothing to do with the background job itself, but rather the API's it calls.

    In your specific case, the exception is throw after a ResourceNotFoundException, which happens when there's no route defined for such URL pattern.

    Possible problems:

    If the background job does a file_get_contents or curl on your own API's, it may be calling a route that does not exist and then throwing that exception.

    If you don't have control of the URL's the background job is downloading, it may be trying to fetch an URL like 127.0.0.1, localhost or anything like that.

提交回复
热议问题