Documentation

NamespaceExceptionFactory
in package
implements ExceptionFactoryInterface

Attempts to create exceptions by inferring the name from the code and a base namespace that contains exceptions. Exception classes are expected to be in upper camelCase and always end in 'Exception'. 'Exception' will be appended if it is not present in the exception code.

Table of Contents

Interfaces

ExceptionFactoryInterface
Interface used to create AWS exception

Properties

$baseNamespace  : string
$defaultException  : string
$parser  : ExceptionParserInterface

Methods

__construct()  : mixed
fromResponse()  : Exception|AwsExceptionInterface
Returns an AWS service specific exception
createException()  : Exception
Create an prepare an exception object

Properties

Methods

__construct()

public __construct(ExceptionParserInterface $parser, string $baseNamespace[, string $defaultException = 'AwsCommonExceptionServiceResponseException' ]) : mixed
Parameters
$parser : ExceptionParserInterface

Parser used to parse exceptions

$baseNamespace : string

Namespace containing exceptions

$defaultException : string = 'AwsCommonExceptionServiceResponseException'

Default class to use if one is not mapped

createException()

Create an prepare an exception object

protected createException(string $className, RequestInterface $request, Response $response, array<string|int, mixed> $parts) : Exception
Parameters
$className : string

Name of the class to create

$request : RequestInterface

Request

$response : Response

Response received

$parts : array<string|int, mixed>

Parsed exception data

Return values
Exception
Loading…
On this page

Search results