Documentation

CloudProviderException extends BaseException
in package

Base Exception for TiqUtilities package

This class serves as the foundation for all custom exceptions in the TiqUtilities package. It extends the PHP's built-in Exception class and provides additional functionality for consistent error handling across the application.

Use this class as the parent for all domain-specific exceptions in TiqUtilities to ensure consistent behavior and to simplify exception catching.

Table of Contents

Properties

$context  : array<string|int, mixed>

Methods

__construct()  : mixed
BaseException constructor.
addContext()  : $this
Add additional context data to the exception
format()  : string
Format the exception for logging or display
getContext()  : array<string|int, mixed>
Get additional context data for the exception

Properties

$context

protected array<string|int, mixed> $context = []

Additional context data for the exception

Methods

__construct()

BaseException constructor.

public __construct(mixed $message[, mixed $code = 0 ][, Exception $previous = null ]) : mixed
Parameters
$message : mixed

The exception message

$code : mixed = 0

The exception code

$previous : Exception = null

Previous exception used for exception chaining

addContext()

Add additional context data to the exception

public addContext(string $key, mixed $value) : $this
Parameters
$key : string

Context key

$value : mixed

Context value

Return values
$this

format()

Format the exception for logging or display

public format() : string
Return values
string

getContext()

Get additional context data for the exception

public getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results