br-error-contract
Installation
SKILL.md
better-route: error contract
Throw ApiException for deliberate caller-visible failures. Let unexpected throwables be scrubbed.
use BetterRoute\Http\ApiException;
throw new ApiException(
message: 'Order is temporarily locked.',
status: 409,
errorCode: 'order_locked',
details: ['orderId' => $id],
headers: ['Retry-After' => '5'],
);
The default envelope is: