final |
|---|
Encodes a sealed {@see ActionResponse} (and a technical failure) into the wire envelopes of §6 — a pure function of its input, so the whole contract is table-testable without an HTTP request.
{ status: "Success", message, data, messages, sideEffects }.{ status: "Error", message, errors: {}, messages },
byte-shape-identical to what {@see \LaravelUi5\Sdk\Http\Requests\AbstractSdkFormRequest}
emits for a validation failure, so the client parses both the same way.
errors is an empty object (business failures target no fields); the rich
detail rides messages.APP_DEBUG, else a friendly { message, correlationId } with the
stacktrace logged (never on the wire).The $debug flag is passed in (not read from config()) so this stays pure.
| Methods | ||
|---|---|---|
public
|
toResponse(ActionResponse $response): JsonResponse
|
# |
public
|
technicalFailure(Throwable $e, bool $debug): JsonResponse
|
# |