Skip to content

NotFoundException

PSR-11 NotFoundExceptionInterface: nothing is bound under the requested id and no autowireable class or alias answers to it either.

Thrown by Container::get() only when resolution finds no candidate at all. A candidate that exists but cannot be built fails with ContainerException instead, so “there is no such service” stays distinguishable from “the service is broken”. Container::tryGet() answers null rather than raising this.

class NotFoundException extends RuntimeException implements NotFoundExceptionInterface

ExtendsRuntimeException
ImplementsNotFoundExceptionInterface
SourceDI/Container.php

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
getCode()Exception
getFile()Exception
getLine()Exception
getMessage()Exception
getPrevious()Exception
getTrace()Exception
getTraceAsString()Exception