Useless error messages

I often see useless errors like "A dependency injection object is required to access the 'response' service", but where it throws? How can I locate the incorrect code?


In your public/index.php, at the end of the file, you'll see a try/catch block, you can print the backtrace there to see where the exception is generated:

try {


} catch (Exception $e) {
    echo $e->getMessage(), '<br>';
    echo $e->getTraceAsString(), '<br>';

Thanks :)