StoreFailure
in package
FinalYes
Converts a caught Store operation exception into a bridge response.
- A Store domain exception (
Models/Exceptions/) carries a message meant for the operator (for example insufficient stock), so a stableerrorcode and the message are returned unchanged. - Any other
Throwable(DBAL, ORM, TypeError) gets a stable generic code, a generic message and a short correlationrefthat is also logged. The exception text and the PHP class name never leave the server.
The exception is always logged (channel store).
Table of Contents
Constants
- GENERIC_ERROR : string = 'storeOperationFailed'
Methods
- fromThrowable() : array{error: string, message: string, ref?: string}
Constants
GENERIC_ERROR
public
string
GENERIC_ERROR
= 'storeOperationFailed'
Methods
fromThrowable()
public
static fromThrowable(Throwable $e) : array{error: string, message: string, ref?: string}
Parameters
- $e : Throwable